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
Plsss help me<br>give two examples of problems that can occur when sytems do not work properly​
melomori [17]

Answer:

Explanation:

1. There can be a run out of something ex. The water cycle we could run out of water if evaporation stops happening

2. Something wont happen ex. In a shoe factory if no one is boxing the shoes the shoes don’t get boxed.

Hope this helps

6 0
2 years ago
Given two input integers for an arrowhead and arrow body, print a right-facing arrow.
Zanzabum

Answer:

I don't know the language this is but here is something that will work for all lang

int num0 = 0;

int num1 = 0;

basically just print the ints in the right dimension

Explanation:

Sorry if I am wrong

I don't know much about this someone else's answer might be better than mine

3 0
3 years ago
Jenny wants to create an animated short video to add to her website. Which software will she use to create this animated video?
denis23 [38]
Adobe Spark or Adobe Premier.
6 0
3 years ago
When students have computer trouble they usually are expected to
Kitty [74]

Answer: A) Make any simple fixes on their own.

5 0
3 years ago
Read 2 more answers
Which payment method typically charge is the highest interest rates?
jek_recluse [69]

The highest amount is Credit. The more you wait the higher the interest, higher the interest the more you pay, and no one wants to play more. Stay safe use debit as much as you can

8 0
3 years ago
Other questions:
  • What is the utility of a lever?
    11·2 answers
  • ​A(n) ____ will hold an online auction buyer’s payment until he or she is satisfied that the item bought matches the seller’s de
    13·1 answer
  • Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() pri
    12·1 answer
  • Which of these is one of the primary concerns for protecting your family when online?
    9·2 answers
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    8·1 answer
  • Computer spreadsheet is a grid of​
    9·1 answer
  • Please help
    15·1 answer
  • ________________, _______________ and ___________ are what you see when you open Excel
    14·2 answers
  • Fill in the blanks <br>a) an _______________ checks the files on the computer for viruses.​
    6·2 answers
  • A(n) ___ is a set of CPUs which work in parallel in an attempt to simulate the way the human brain works, although in greatly si
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!