subject

Given that two int variables, total and amount, have been declared, write a loop that reads non-negative values into amount and adds them into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor Notes: Be sure to complete exercises 10087 and 10088 before attempting 10089. "Reads non-negative values into amount" means that values are read (input) into amount from stdin. As long as a given input value is non-negative, the code keeps adding the result into total. But, if a negative value is read, then the loop terminates, without adding that negative result into total. The negative value is known as a "sentinel" value, which means a value that signals something rather than having a quantitative meaning.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:00, willowcollins3753
Write a program that uses a widgetviewer object to do the following: generate two random integers between 1 and 9 (inclusive). name one of them x, the other y. display them to the user using jlabel objects. create a jlabel object displaying the text "enter an operation number." create a jtextfield for the user's input. create a jbutton displaying the text "press here when you've entered your operation." use addandwait to add it to the widgetviewer object. when the user clicks the jbutton, evaluate operation in the following order to determine the one and only mathematical operation to perform on x and y. use a jlabel to display the result. if operation is between 1 and 10 inclusive, add x and y. if operation is evenly divisible by 4, subtract y from x. if operation is evenly divisible by 5, use integer division to divide y into x. if operation is an even number, use floating point division to divide y into x. if none of the other tests on operation apply, multiply x and y. note: operation can be negative or zero.
Answers: 2
image
Computers and Technology, 23.06.2019 07:00, lin550
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
image
Computers and Technology, 24.06.2019 01:00, gymnast8900
Me if you do then you get 10 points and brainliest
Answers: 1
image
Computers and Technology, 24.06.2019 05:30, lolololol21
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
You know the right answer?
Given that two int variables, total and amount, have been declared, write a loop that reads non-nega...

Questions in other subjects:

Konu
History, 16.11.2019 06:31