1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
IrinaK [193]
3 years ago
11

Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all th

e non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0.
Computers and Technology
1 answer:
Whitepunk [10]3 years ago
8 0

Answer:

Following are the statement in C++ Language is given below

total=0; // variable declaration

cin >> amount; // Read the input

while(amount >=0) //iterating the loop

{

if(amount>0) // checking condition

total=total+amount; // perform operation

}

Explanation:

Following is the description of the statement

  • Declared a variable "total" and initialized with them 0 to them.
  • Read the input in the "amount" variable by using cin.
  • iterating the loop when the amount is greater then 0.
  • Checking the condition if(amount>0) then adding the total variable and amount and storing them into the total variable.

You might be interested in
What is the reason for taking care of design a good computer human interface ​
anygoal [31]

Answer:

computer is one of the part of our technology so that let's take care of it and improve so that we can used for better and sufficient ly not maybe now but maybe soon.

3 0
3 years ago
Read 2 more answers
Let's play Silly Sentences!
Mrac [35]

Answer:

Grace sat quietly in a stinky stadium with her blue jacket

Grace jumped on a plane to Paris.

Grace ate bananas, apples, and guavas quietly while she listened to the news.

Grace is the name of a major character in my favorite novel

Grace was looking so beautiful as she walked to the podium majestically.

Grace looked on angrily at the blue-faced policeman who blocked her way.

3 0
3 years ago
9) Which date is assigned the serial number of 1?
goldenfox [79]

9) Which date is assigned the serial number of 1?

A. January 1, 1700

B. January 1, 2000

  • C. January 1, 1900

D. January 1, 1800

7 0
2 years ago
Read 2 more answers
Which of the following is not possible? A class that implements two interfaces. A class that inherits from two classes. A class
ozzi

Answer:

"A class that inherits from two classes"

Explanation:

If we're talking about Java, you can't extend from two classes. The reason for this is Java doesn't allow multiple inheritance.

The reason for this is to avoid the ambiguity caused by it. One of the cases where multiple inheritance can cause ambiguity is the diamond problem.

Diamond problem can occur if two classes (say B and C) inherit from one class (say A). And another class (say D) inherits from both B & C.

If B and C class override the same method from A class. And D class calls that method, which one will be called, class B's or C's??

4 0
3 years ago
Which functions can you use to find the square root of a number, and to find the current date, respectively?
JulsSmile [24]

1. A. the SQRT is the squareroot. 2. may be C. Today but I've never heard of a function that returns the date!

8 0
3 years ago
Read 2 more answers
Other questions:
  • In a database, a collection of related fields that describes some object or activity is referred to as a ____.
    9·1 answer
  • He smallest network is a ______________________, which is a network of personal devices, such as the network you use when you sy
    5·1 answer
  • The git _____ command will display the last commit and what were the changes you made.
    9·1 answer
  • Skinner designed a soundproof apparatus, often equipped with a lever or bar, with which he conducted his experiments in operant
    9·1 answer
  • What is an activity that can help you enhance the appearance of your computer’s desktop?
    13·1 answer
  • 9. What is composition? Why is composition important?
    11·1 answer
  • How many times would the following loop iterate?
    15·1 answer
  • Which shortcut key combination will move the cursor to the beginning of the line?
    13·1 answer
  • Give me 4 examples of things to consider as a sound designer?<br> HURYYYYY IM TIMED
    11·1 answer
  • List three features of the third generation of computers
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!