Question: Write a program in C++ that sums a simple series. Here are the criteria. The program requests a number greater than If zero is entered,
Write a program in C++ that sums a simple series. Here are the criteria.
- The program requests a number greater than If zero is entered, the program stops. If a number equal to 1 or less than 0 is entered, the program should give an error and return to request another number. The same is true for entering anything other than a number. Your program should not crash or do strange things if you enter the letter A when it asks for a number.
- If the number entered is N, sum the series 1/N + 2/N-1 + 3/N-2+ +N/1. Display the original number and the sum.
- Return to request another number.
The objective of this program is for you to demonstrate your knowledge of loops, conditionals, and computation in C++. Try to write this with the fewest number of variables and lines of code as possible. Test the program with small numbers where you can compute the result by hand.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
