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
Panes created using the vertical split bar scroll together horizontally. true or false.
Nataly_w [17]
I think the statement given above is false. Panes created using the vertical split bar do not scroll together horizontally. <span>The two </span>panes scroll together vertically, but scroll<span> independently </span>horizontally<span>. Hope this answers the question. Have a nice day.</span>
4 0
3 years ago
Ayuda no encuentro la información de estas tres preguntas:
Morgarella [4.7K]

Answer:

Sorry i don't know.........!!!!!!!!!!

Explanation:

3 0
3 years ago
HELP ME PLZZ FFFAAASSSTTTT
Dahasolnce [82]
The answer has to be A because we you get your licensed suspended you are un able to drive for a while Intel you take the test again and or pay a fine
6 0
3 years ago
Read 2 more answers
In Python, while loops will repeat during the time the test condition is true.
frez [133]

Answer:

It is true

Explanation:

3 0
2 years ago
Read 2 more answers
Do you agree with the EU's decision that people should be able to ask Google to remove search results that contain incorrect, un
AnnyKZ [126]

Answer: Yes

Explanation: One should not be able to just find negative information on someone just because they googled it (unless they're famous of course)

7 0
3 years ago
Read 2 more answers
Other questions:
  • The CPU is referred to as the ______ of the computer.
    14·2 answers
  • ATM is an abbreviation that stands for Automatic Teller machine?
    5·2 answers
  • All of the following except one are issues that should be covered in an AUP. Which one is the exception?
    5·1 answer
  • What identifies available computers through the internet?
    14·1 answer
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • Write a function called activity which takes an integer parameter X that does the following:
    6·1 answer
  • An Organization Chart to support the Appliance Warehouse case study The SWOT Analysis diagram you performed and created to suppo
    13·1 answer
  • Select the correct answer.
    15·2 answers
  • I need some help with this assignment. I'm having difficulty trying come up ideas to use here. Can I get any help?
    5·1 answer
  • How is technology moving the business world forward?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!