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
The price elasticity of demand for mobile phones a. will be higher if there is an improvement in the production technology. b. w
rodikova [14]

Answer:

b. will be lower if consumers perceive mobile phones to be a necessity.

Explanation:

The price elasticity of demand is described as the percentage variation in the demanded quantity of service or goods divided by the change in the percentage of the price. And henceforth it describes the responsiveness of the demanded quantity to a price change. And now if the mobile phones are thought of as being the necessity then the price will increase as demand will increase, and hence the price elasticity of demand will be lower. And if there is an improvement in the production technology then the price will be lowered, and hence price elasticity of demand will be less as the change in the percentage of the price will be negative. And the exact definition of it as we have described above. Hence, b is correct options.

3 0
3 years ago
Rebecca is creating a method for her class, but wants to make sure that a variable in the method satisfies a conditional phrase.
astraxan [27]

Answer:

D. an assertion

From PLATO

6 0
3 years ago
Which of the following is a type of intangible business property that is protected by law
xz_007 [3.2K]
Google might be it ok
6 0
3 years ago
In a database, data is stored in spreadsheets which have rows and columns.
Tcecarenko [31]
The answer is A. True.
5 0
3 years ago
Complete the sentence.<br> A text messaging application is an example of a _____ application.
Ne4ueva [31]

Answer:

chat application

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • What is the name for the individual sections of the ribbon in PowerPoint 20162
    8·1 answer
  • A(n) _____ allows a user to choose specific files to back up, regardless of whether or not the files have been changed.
    9·1 answer
  • What forms the foundation of cloud computing?
    12·1 answer
  • May indicate elevation
    14·2 answers
  • What is the nickname given to the new generation that was raised entirely within the digital age and often communicates through
    7·2 answers
  • Students who respond promptly to e-mails are following which netiquette rule?
    13·2 answers
  • A computer has been stored, uncovered, in a dusty closet for several months. Why might this situation cause the operating system
    13·1 answer
  • What is also known as a visual aid in presentation
    15·1 answer
  • Omega Software Inc. is currently running a training program for employees to upgrade their software skills so that they are able
    10·1 answer
  • What color mode would you use when designing for web &amp; devices?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!