subject

Write a program that reads in an integer greater than 1 in from the user. the program then computes and print out the factorial of the number read in. the factorial of a number is the product of all the natural numbers less than or equal to the number itself. that is the factorial of n is 1*2*3* (n-2)*(n1)*n. your program should stop if the user enters a negative number. design you will probably want to make a class called integer which has a single instance variable of class int. this class would also have an accessor method for the value and a method factorial, which will compute the factorial. this separates the input and output from the computation. sample output enter a number: 5 the factorial of 5 is 120. enter a number: 8 the factorial of 8 is 40320. enter a number: 12 the factorial of 12 is 479001600. enter a number: -1 you and bye.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
question
Computers and Technology, 24.06.2019 23:30
What is the opening page of a website called? a. web page b. landing page c. homepage d. opening page
Answers: 1
question
Computers and Technology, 25.06.2019 23:30
Lisa is modifying a spreadsheet. which view will allow lisa to see how her changes will look when she prints the spreadsheet?
Answers: 1
You know the right answer?
Write a program that reads in an integer greater than 1 in from the user. the program then computes...
Questions
question
Mathematics, 12.08.2019 00:10
question
Computers and Technology, 12.08.2019 00:10
Questions on the website: 13722363