subject
Engineering, 06.11.2020 01:00 jprofaci29

At the beginning of the program, you ask the user how many numbers he or she wants to add. In the while-block, you prompt the user for the numbers to add. Here are the requirements:

Make the first statement the prompt to the user asking how many numbers to add. Assign that information to a variable called numbers_to_add.

Initialize the sum to 0.

Initialize the counter to 1.

Write a while-loop that runs while the counter is less than or equal to the number of numbers the user intends to enter.

In the while-block, prompt the user for the first number to add and assign it to a variable called number.

Add the number to the existing sum (which, the first time through, is 0).

Increment the counter by one.

Print out the sum ("The sum is ").

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
question
Engineering, 04.07.2019 18:10
Calculate the bore of a cylinder that has a stroke of 18 inches and an extension time of 6 seconds at a flow rate of 4 gal/min.
Answers: 3
question
Engineering, 04.07.2019 18:20
For a gate width of 2 m into the paper, determine the force required to hold the gate abc at its location.
Answers: 1
question
Engineering, 04.07.2019 18:20
A2-m rigid tank initially contains saturated water vapor at 100 kpa. the tank is connected to a supply line through a valve. steam is flowing in the supply line at 600 kpa and 300 c. the valve is opened, and steam is allowed to enter the tank until the pressure in the tank reaches the line pressure, at which point the valve is closed. a thermometer placed in the tank indicates that the temperature at the final state is 200°c. determine (a) the mass of steam that has entered the tank (b) the amount of heat transfer.
Answers: 3
You know the right answer?
At the beginning of the program, you ask the user how many numbers he or she wants to add. In the wh...
Questions
question
Mathematics, 16.09.2019 16:30
question
English, 16.09.2019 16:30
question
History, 16.09.2019 16:30
Questions on the website: 13722363