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]
4 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]4 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
A(n) _____ is a network connection device that can build tables that identify addresses on each network.
Neko [114]

Answer:

Dynamic Router

Explanation:

5 0
3 years ago
Solve this for brainlest​
saw5 [17]

Answer:

which chapter is this

Explanation:

6 0
3 years ago
kayah has created a website that explains what her business does. what type of computer program is needed to access/view kayah's
soldier1979 [14.2K]

Answer:

web browser

Explanation:

A web browser is a program that allows users to view and explore

information on the World Wide Web.

8 0
3 years ago
Read 2 more answers
Estimate how many searches will be needed to justify time spent on presorting an array of 101 elements if sorting is done by mer
sertanlavr [38]

Answer:

Merge sort is sort, which contains the same elements in the array to maintain original positions concerning each other. Complexity of sort is O (nLogn) and runtime is O(nlogn)

Explanation:

Estimate time spent on presorting an array 101 element in merge and binary search, two schemes can be used in the first scheme if 101 items in sequential search then use the complexity of O(n). In the second scheme covert, the list into an array then sort an array with the complexity of O(n log n) and fetch the 101 elements.

Merge 101 elements; presorted sub-array n items have to compare the top times in sub-array and choose the maximum item and place it in a sorted array. Time for merging is proportional to ( k-1) n.

Suppose the processing time of the merger is c.(k-1) .n then scale factor has the same value.

The processing time of a sorting array is a recurrence equation.

T(n) = 3T (n/3) + 2 cn

Similarly this implement for array of 105 element.

5 0
4 years ago
What is computer hardware / software​
Pavel [41]

Answer: <u>Computer hardware is any physical device used in or with your machine, like for example, a mouse, or a keyboard.</u> Computer software is a collection of programming code installed on your computer's hard drive it can process billions of data and inputs through this.

Hope this helps!

5 0
3 years ago
Other questions:
  • Beside homework, what products can you use for personal use? Identify three uses and briefly describe.
    15·1 answer
  • ​what is the best advice to follow when using texting or instant messaging (im) in the workplace
    5·1 answer
  • A robot can complete 7 tasks in hour. Each task takes the same amount of time.
    15·2 answers
  • Sarah has entered data about football players from team A and team B in a worksheet. She enters names of players from team A wit
    9·2 answers
  • I'm lonely every 14 and up come talk
    5·2 answers
  • To execute a command object and store the results in a dataset, you use the Group of answer choices Fill method of a data adapte
    5·1 answer
  • :|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|
    5·2 answers
  • tiny electrical paths to connect everything together is called ? A. graphic card B. audio card C. CPU D. Motherboard
    6·1 answer
  • Peyton is having trouble searching for information on butter lettuce. Every time he searches for it, he gets some results for bu
    6·2 answers
  • susan wrote the recursive formula for the sequence represented by the exploit formula An=3+2n. put an C net to any correct state
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!