Problem 5 Develop a program that asks the user to enter a number If the user enters 1 the

Problem 5) Develop a program that asks the user to enter a number. If the user enters 1, the program computes and displays the value of S1. If the user enters 2, the program computes and displays the value of S2. If the user enters something else, the program displays the message: "invalid choice". The following equations define S1 and S2: S1 = ∑(k=1 to N) k S2 = ∑(r=1 to N) r + 5r The user provides the value of N. Problem 6) Develop a C++ program that continuously prompts the user to enter a positive number until the user enters a negative number to terminate the entry process. When this happens, the program should display the sum of the positive numbers entered by the user. For example, if the user enters 4, 1, 5, 2, 3, the sum computed by the program should be 12 (the negative number is not included in the sum).

Problem 5) Develop a program that asks the user to enter a number. If the user enters 1, the program computes and displays the value of S1. If the user enters 2, the program computes and displays the value of S2. If the user enters something else, the program displays the message: “invalid choice”. The following equations define S1 and S2:

S1 = ∑(k=1 to N) k
S2 = ∑(r=1 to N) r + 5r

The user provides the value of N.

Problem 6) Develop a C++ program that continuously prompts the user to enter a positive number until the user enters a negative number to terminate the entry process. When this happens, the program should display the sum of the positive numbers entered by the user. For example, if the user enters 4, 1, 5, 2, 3, the sum computed by the program should be 12 (the negative number is not included in the sum).


 
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.

 
Instant
Download

Student review: (6 ratings) 6 out of 6 people found this solution helpful.