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
lbvjy [14]
3 years ago
10

Please code this in c++

Computers and Technology
1 answer:
katrin [286]3 years ago
5 0

Answer:

See explaination

Explanation:

#include<iostream>

#include<fstream>

using namespace std;

int main(){

double price, totalPrice = 0, weight;

string product, filename;

cout<<"Enter filename: ";

cin>>filename;

ifstream fin;

fin.open(filename.c_str());

while(fin>>product>>price){

cout<<"Enter weight for "<<product<<": ";

cin>>weight;

totalPrice+=price*weight;

}

cout<<"\nThe total cost of the purchase: $"<<totalPrice<<endl;

return 0;

}

You might be interested in
Discuss different ways to respond to errors, such as notifying the user onscreen, writing to an error log, notifying the develop
Ronch [10]

Answer:

Notifying the errors is always useful .

Explanation:

The errors should always be notified to the developer. It is useful and is important. When we provide notifications on the screen, it helps the user and it can be used to provide feedback. In regard to developmental work, it has to be important and confidential and we use the help of email to inform or notify errors to the organization. This will help the company from negative criticism and helps the company perform better. We can also write an error log when we face the same error again and again even after notifying the developer organization. This helps to put a reminder to the organization that immediate check has to be dome and eliminate the error from the source.

Some disadvantages are if we do not keep timer implementation, the alert keeps on popping on the screen, which is irritable.

4 0
2 years ago
What is not an example of ai
BARSIC [14]

Answer:

human

Explanation:

because it is not a machine

8 0
2 years ago
Read 2 more answers
If you need to change the typeface of a document, which menu will you choose?
Nezavi [6.7K]

Format menu

Format menu is used to change typeface of a document

6 0
2 years ago
Seeing her Daughter graduate from college is most likely a short term goal for a person of which of these ages ? A) 24 years old
scoray [572]
C because you can’t graduate at 4 or 14 and if your kid is graduating when you’re 24 then that means you have birth at 7 years old which isn’t possible.
4 0
2 years ago
Describe how networks and individual computers connect to the internet
Alborosie

Answer:

One network connects the computers/devices with cables and the other connects the computers/devices using wireless. The cabled network cannot communicate with the wireless network and vice versa. By using a bridge, all of the computers/devices can communicate with each other as one single LAN.

7 0
3 years ago
Other questions:
  • You are attempting to update a Windows image that has been mounted under C:\mount on your local system. What command must you us
    13·1 answer
  • For a color display using 8 bits for each of the primary colors (red, green, blue) per pixel, what should be the minimum size in
    6·1 answer
  • A firewall is either software or dedicated hardware that exists between the __________ being protected.
    13·1 answer
  • Which statement is true of Web-based electronic data interchange (Open EDI)? a. It consists of international agreements on priva
    7·1 answer
  • When selecting current page from the print range, on the print dialong box it will print
    5·1 answer
  • The introduction of new information technology has a: A. dampening effect on the discourse of business ethics. B. waterfall effe
    14·1 answer
  • A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
    10·1 answer
  • 1
    5·1 answer
  • Which item is essential to know before sketching a navigation menu flowchart?
    7·2 answers
  • 010101010101011101011
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!