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.

  1. 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.
  2. 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.
  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!