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
Cari brought 2 pounds of grapes at the grocery store she ate 5 ounces of the grapes on way home what is the weight of the grapes
sveta [45]

Answer:

27 ounces

Explanation:

You can convert 2 pounds into 32 ounces then subtract the 5 ounces that she ate from that 32.

7 0
3 years ago
A type of indent where the first line of text starts at the left margin and the second and succeeding lines of text are indented
9966 [12]

Answer: The first line intent

Explanation:

 The first line intent is one of the type of intent and the first line of the text are mainly starts from the left margin. It is one of the most common method to start the line or text with the new paragraph. We use the tab key for creating the first line indent in the word.

In the first line indent the second line are basically known as the succeeding line of the text that contain the various indented bullets.

3 0
3 years ago
Read 2 more answers
____________________________ and _________________________ are 2 positive impacts of the internet on businesses.
ZanzabumX [31]
D improved comms and easy ads
4 0
3 years ago
Read 2 more answers
Someone who wants to learn a skilled trade on the job should consider
Alexeev081 [22]
Someone who wants to learn a skilled trade on the job should consider enrolling in class for the knowledge and skills.
5 0
3 years ago
Read 2 more answers
How to see if your computer has bluetooth?
RUDIKE [14]
Assuming you're running Windows, click the start button, and then search for "Device Manager" (or open CMD or PowerShell and type devmgmt.msc). Look at the list of devices. If Bluetooth is there, you have it; if it's not there, you don't. 
3 0
3 years ago
Other questions:
  • Explain possible consequences if someone is issued with a fraudulent licence
    6·1 answer
  • The Table Tools tab provides which two additional tabs?
    5·1 answer
  • Consider a Games Expo for Children. Six competitions are laid out for the expo. Tickets are sold according to the age and gender
    11·1 answer
  • How would you define media literacy?
    12·1 answer
  • What is TCP/IP adress​
    10·1 answer
  • Power point presentation make use of pages known as
    9·2 answers
  • Int a = 1; int b = 0; int c = -1; if ((b + 1) == a) { b++; c += b; } if (c == a) { a--; b = 4; }
    7·1 answer
  • Have all of my coins because i will delete acount there will be part 2, 3 , 4 ,5,6,7,8
    15·2 answers
  • A. Get a value for x from the user.
    13·1 answer
  • Mario kart is mercedes lol
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!