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
A toolkit is:
ad-work [718]

Answer: A) Set of related,reusable classes that provide a well defined set of functionality  

Explanation: Tool kit is defined as single program for utilization that has set of software plan that has numerous functions. It is also used for developing and maintaining applications and databases. It is the basic collection of the tools that help in the functioning of class. The classes present can be re-utilized. Therefore, Option (A) is the correct option.

4 0
4 years ago
Whats the highest rank in brainly
vampirchik [111]

1. Beginner

2. Apprentice

3. Rising star

4. Helping Hand

5. Ambitious

6. Virtuoso

7. Expert

8. Ace

9. Genius

8 0
3 years ago
Read 2 more answers
(05.01 MC)
KiRa [710]

Answer:

0xff

Explanation:

the thing is that hexadecimal always starts with 0x

and theres only one option that starts with 0x

4 0
3 years ago
Please answer ASAP!!!!!!
Blababa [14]

Answer:

the first constructor invocation will work.

pet temp("mouse", 5.99);

Explanation:

This will create a pet object on the stack, using the constructor.

If you want to create an object on the heap, you would use the new operator:

pet* pTemp = new pet("mouse", 5.99);

3 0
3 years ago
Figuring out why your computer won't turn on falls under diagnosing.<br> A. True<br> B. False
igomit [66]
The answer to your question, is true
hope this helps :D
7 0
3 years ago
Read 2 more answers
Other questions:
  • In excel, a cell is referred to by its cell __________, which is the coordinates of the intersection of a column and a row. answ
    14·1 answer
  • Write a function named sortie that takes three integer parameters by reference and rearranges them in ascending order--the first
    6·1 answer
  • How did the movie characterized being a genius on real genius movie
    13·2 answers
  • Write a function that creates a one-dimensional game board composed of agents of two different types (0 and 1, X and O, stars an
    11·1 answer
  • Why is fluency in information technology becoming increasingly important for many college majors?
    6·1 answer
  • Fill in the blanks of the SQL Statements: Fund_Id VARCHAR(10) , Donor_id VARCHAR(10) , Count_Of_Receipts INTEGER, Total_Receipts
    15·1 answer
  • Consider the following class declaration.
    6·1 answer
  • Define a function typeHistogram that takes an iterator ""it"" (representing a sequence of values of different types) and builds
    12·1 answer
  • Do a comment if u hate me.or think im d.U.m b. add a answer if u dont care. thank all the asnwers or report for saying i dont ex
    9·1 answer
  • What is the best resource to learn python?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!