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
Classify the characteristics as abstract classes or interfaces.
Sergeu [11.5K]
E for eeeedeerreeeee
4 0
3 years ago
Ask the user to input a country name. Display the output the message “I
Sever21 [200]

Answer:

Explanation:

The following code is written in Python, it asks the user for an input saves it to a variable called country, and then prints out the sentence example in the question using the user's input. The output can be seen in the picture attached below

country = input("input country")

print('I would love to go to ' + country)

4 0
3 years ago
ap csp The local, remote, and upstream _______ can each have multiple ___ _____. When a participant in a collaborative group on
ratelena [41]

Answer:

The Local, Remote and Upstream repository can each have multiple push /pull requests. When  a Participant in a collaborative group on Github is ready to have their work used by the group,  the participants makes a pull request.

Explanation:

These are simple blanks which are answer here

The Local, Remote and Upstream <u>repository</u> can each have multiple <u>push /pull</u> requests. When  a Participant in a collaborative group on Github is ready to have their work used by the group,  the participants makes a <u>pull request</u>.

8 0
3 years ago
Free point giveaway pt.10 and brainliest to first answer
g100num [7]

Answer:

3+3=6

Explanation:

Tysm!!!

8 0
3 years ago
Read 2 more answers
Which of the following does not reflect the second step of effective communication?
Ilya [14]

Answer:

c

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • The exception classes are in packages in the ________.
    11·1 answer
  • Why when i create a powerpoint on word it doesn't open properly in other programmes
    5·1 answer
  • A difference between crt monitors and flat-panel displays is that most flat-panel displays use digital signals to display images
    8·1 answer
  • Which should be your first choice for the most efficient and successful job search method?
    10·1 answer
  • What is a benefit of Virtualization for organizations?
    15·2 answers
  • If a laptop is getting no power while plugged in, which hardware part often needs to be replaced?
    5·1 answer
  • An animation is made up of individual images called _______________.
    11·1 answer
  • Supplies/material used in iron​
    11·1 answer
  • What would be the code of this in HTML ??
    13·1 answer
  • Place a check next to each of the choices that describe an example of proper ergonomics. (more than 1 answer)
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!