Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make IPO CHART. Thank you so much. 1) Consider the following computer programming problem: We wish to write a program that computes the factorial of

image text in transcribedMake IPO CHART. Thank you so much.
1) Consider the following computer programming problem: We wish to write a program that computes the factorial of a number and displays it. A factorial of a number (written N!) is defined as N * (N-1) * (N-2) * (N.3) *1 In other words,5!-5 4 3 2 1 120 and 3!-3.2 16. For more info about a factorial, have a look at http://www.mathsisfun.comumbers/factorial html or http:/www.purplemath.com/modules/factorial.htm (or you can just Google factorial"). Your program should take an integer between 2 and 60 as input. Be sure you display that in the prompt. The factorial of 0 is 1 and the factorial of 1 is also 1 so we don't care about those, and the factorial of numbers over 60 is way too large to display. Check the input value first, and if it's outside of those bounds simply show an error message, then stop. If it is between 2 and 60, use a loop to compute the factorial, then display the factorial and stop. You MUST use a loop to compute the factorial! We know you can figure it out on calculator or look it up in a table but that doesn't matter, the answer has to be calculated. Notes: While the factorial is N (N-1) (N-2), that is a multiply that works by going down or backwards.. 5!-5*4 3*2*1 You can have your loop do that, or you can go up.. 1 3 3*4 5. Either way is fine. While these are really all integers, the range of integers in C++ is limited and these numbers get HUGE fast. So, use a double to hold the factorial values as it totals up At some point, the numbers get large enough to where the display will assume scientific notation form. For example, the factorial of 15 is 1.30767e+012. Let it display just like that 9 "You can check your program against your calculator's factorial key to see if your logic is correct. For the first time, we are doing a little error checking on the input, as you read above. The range of 2-60 is the only thing to check for Do NOT worry about-or deal with-possible other errors such as non-integers or even non-numbers as input. Ignore those Do NOT decide in any program to go "beyond the specification" and add things that you think might make it better-that is dangerous! If the user enters a value out of range, just do what the instructions tell you to do - show an error message and STOP. Don't try to "improve" on that. Once you know how to do it, this is actually quite a short program. 2) Write up an IPO chart for this problem. Be sure to have an "Input, Processing, Output and Algorithm" part

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions