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
almond37 [142]
3 years ago
5

Write a C++ programthat simulates a cash register. The user should keeptyping

Computers and Technology
1 answer:
-Dominant- [34]3 years ago
6 0

Answer:

//C++ code for the cash register..

#include <iostream>

#include<vector> //including vector library

using namespace std;

int main() {

vector<float> cash; //declaring a vector of type float.

float item=2,cash_sum=0;

int counter=1;

while(item!=0)//inserting prices in the vector until user enters 0...

{

    cout<<"Enter the price of item "<<counter<<" :"<<endl;

cin>>item;

counter++;

cash.push_back(item);//inserting element in the vector...

}

for(int i=0;i<cash.size();i++)//looping over the vector...

{

    cash_sum+=cash[i];//summing each element..

}

cash_sum*=1.08;//adding 8% sales tax.

cout<<cash_sum;//printing the result....

return 0;

}

Explanation:

I have taken a vector of type float.

Inserting the price of each item in the vector until user enters 0.

Iterating over the vector for performing the sum operation.

Then after that adding 8% sales tax to the sum.

Printing the output at last.

You might be interested in
What is meant by editing a document​
Doss [256]

Answer: “Editing” in general means fixing problems in a written document so that it has no mistakes and is easy to read

Explanation: Yeah

5 0
3 years ago
Read 2 more answers
News writers get story leads from____.
Andrei [34K]
I believe the answer is B.Press releases! Hope this helps:)
4 0
3 years ago
Programmers refer to a sequence of characters as a ____.
jekas [21]
In programming they know it as a String which is  a sequence of characters that are composed of literal constants or some kind of variables. A sting is any finite sequence of characters. every single string has its own lenght and this is one of the most important characteristics of them. Strings are essential to communicate information from the program to the user. 
5 0
3 years ago
Correct or False, when formatting conditional data, I start by selecting the range of data that I want to format
Arturiano [62]

Answer:

Correct

Explanation:

4 0
4 years ago
Ashley works for a company that helps hospitals hire new doctors. They have written a list of strategies that can be used to int
enyata [817]

Answer:

A file.

Explanation:

A file can be defined as a computer resource used for the collection of data (informations) as a single unit.

Basically, files are of different types or in various formats (forms) and these includes document, video, audio, image, software application, data library etc.

Additionally, various operations such as open, close, edit, format, delete, save, rename, compress etc. can be performed on a file through the use of specific software applications or programs.

In this scenario, Ashley wants to give a list of strategies that can be used to interview doctors to their supervisor to review.

Hence, what Ashley should give to the supervisor to do a review is a file.

6 0
3 years ago
Other questions:
  • Folders are containers used to organize the documents into manageable groups on a designated storage device. true or false
    10·1 answer
  • Digital manipulation is commonly referred to as _______. Kodaking photo-oping Photoshopping photofixing
    6·2 answers
  • At which layer of the osi model is the entire message referred to as the payload
    15·1 answer
  • 40 POINTS PLZ HELP NEED ASAP!!!
    5·1 answer
  • An attacker compromises the Washington Post's web server and proceeds to modify the homepage slightly by inserting a 1x1 pixel i
    12·1 answer
  • Explain Spreadsheet and its Basics
    13·1 answer
  • I need help with the last question pleasee help me guys .
    11·2 answers
  • How easily can teachers see browsing history on chromebook]
    9·1 answer
  • Choose all items that represent features of the job application process.
    5·2 answers
  • Cybersquatters:_________.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!