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]
4 years ago
10

Please code this in c++

Computers and Technology
1 answer:
katrin [286]4 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
What command launches the remote desktop client for windows?
Ksju [112]
%windir%\system32\mstsc.exe

launches the RDP client.
7 0
3 years ago
GoInternet, Inc., is an Internet-access service provider that is being forced to manage numerous unwanted e-mail messages from a
marissa [1.9K]

Answer:

The correct answer to the following question is option b.)sends messages involving products of companies previously sued under the CAN-SPAM Act.

Explanation:

This act is an act of Controlling the Assault of Non-Solicited Marketing And Other things.

It is the law that establish the rules for the commercial message and the commercial e-mails, gives recipients right to have the business stops emailing them, and they outline the penalties incurred for those person who has violated the law.

8 0
3 years ago
Instructions: Use the tables below to answer the questions that follow:
Svet_ta [14]

Answer:

same as above....................

3 0
3 years ago
I have the assembly for the max. can someone change the variables of it and make it min. I mean, the assembly for finding the mi
tatyana61 [14]
Bruh i honeselty dont know
4 0
4 years ago
Server virtualization in windows server 2012 r2 is based on a module called the
alexgriva [62]
<span>Server virtualization in windows server 2012 r2 is based on a module called the</span> hypervisor.
3 0
3 years ago
Other questions:
  • Which function of a web page relies on responsive web design? Adding extra horizontal scroll Blocking mobile devices from viewin
    11·2 answers
  • Which of the Arts, A/V Technology, and Communication career cluster pathways are involved with producing a product for an audien
    8·2 answers
  • Press the _______ key to move to the next cell in a row.
    12·2 answers
  • How to fix Please enable JS and disable any ad blocker
    13·2 answers
  • Given the code segment below, complete the assignments as stated in the comments. struct aaa { int m; int nn; } struct bbb{ stru
    13·1 answer
  • You can use a(n) to call a function in response to an event?
    14·1 answer
  • What can you use on Code.org's Web Lab to find and fix problems when you are writing code for your website?
    13·1 answer
  • Your supervisor has asked you if it is possible to monitor servers for potential port scans via SNMP. What two OIDs can you prov
    13·1 answer
  • Make variables to represent the length and width of a rectangle, called length and width, respectively. You should set length to
    7·1 answer
  • Three healthcare firms jointly own and share the same cloud resources to meet their computing needs. Which cloud model does this
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!