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
Masja [62]
3 years ago
14

Given that two int variables, total and amount, have been declared, write a sequence of statements that: initializes total to 0

reads three values into amount, one at a time. After each value is read in to amount, it is added to the value in total (that is, total is incremented by the value in amount). Instructor Notes: Do not use any looping. Just use three cin statements and three calculations.
Computers and Technology
1 answer:
artcher [175]3 years ago
6 0

Answer:

Following are the program in C++ language :

#include <iostream> // header file

using namespace std; // using namespace

int main() // main method

{

   int amount,total=0; // two int variable declaration

   cout<<" enter amount:";

   cin>>amount; // read input amount first time

   total=total+amount; // first calculation

   cout<<" enter amount:";

   cin>>amount; //read input amount second time

   total=total+amount;// second calculation

   cout<<" enter amount:";

   cin>>amount;// read input amount third time

   total=total+amount;// third calculation

   cout<<"total:"<<total; // display total

  return 0;

}

Output:

enter amount:12

enter amount:12

enter amount:12

total:36

Explanation:

Following are the explanation of program which is mention above

  • Declared the two variable total and amount of int type .
  • Initialize the variable total to "0".
  • Read the 3 input in "amount" variable in one by one by using cin function and adding their value to the "total "variable .
  • Finally display the total.
You might be interested in
Meeting code =nve-hmqq-qxr<br>​
valentina_108 [34]
Uhhhh meeting code for what
7 0
3 years ago
Read 2 more answers
What online game do you play on the internet and can I play with you on it? I play downtown mafia 1960
SashulF [63]

Answer:

None

Explanation:

I find them scary and they give me nightmares

6 0
2 years ago
What are the missing letters _A_TO_ ( 6 letters) a type of computer.
aliina [53]

Explanation:

its a laptop ☺️. . . . . .. . .

4 0
3 years ago
Read 2 more answers
What is the most popular airline in the US?
Degger [83]
American Airlines is the most popular.
4 0
3 years ago
Read 2 more answers
Discuss the importance of using appropriate tools in conducting activity in farming?​
topjm [15]

Answer:

Farm tools can be very helpful to a farmer - just like all tools they improve the efficacy of the work the farmer does, making them more productive. It all depends on the tool and the job it is matched to. There is a gap between the tools that are being sold by various and sundry purveyors and the actual need of the farmer. So far, I have found that bigger is not always better vis-a-vis big tractors and the like. We have more recently purchased lighter tractors on our farm as they work better on wet ground which is what we are dealing with in our most recent wet Springs.

3 0
2 years ago
Other questions:
  • What is the acronym for computerized command provides weather by microphone clicks?
    8·1 answer
  • Which sentences in the passage correctly describe a function?
    11·1 answer
  • According to Holpp and Kelly's approaches to developing vision, the benchmarking approach is more internally focused, whereas th
    6·1 answer
  • JAVA Code:
    14·1 answer
  • Write a function that accepts an argument for a persons name. The method should loop through the number of characters in the nam
    7·1 answer
  • (1)similarities between backspace key and delete key. (2) different between backspace key and delete key. (3) explain the term e
    10·1 answer
  • No down payment, 18 percent / year, payment of $50/month, payment goes first to interest, balance to principal. Write a program
    9·1 answer
  • How do films use camera shots?
    10·2 answers
  • Employing the use of a(n) <br> will help you manage a STEM project.
    13·1 answer
  • Windows hard disks can now use a variety of file systems, including FAT16, FAT32, ____, and Resilient File System.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!