Question: In c++ Write a program that reads a price and a quantity from an input file, determines the total bill (price quantity) and prints the

In c++  In c++ Write a program that reads a price and a

Write a program that reads a price and a quantity from an input file, determines the total bill (price quantity) and prints the total bill to an output file Hints and what program should include Input file name should be called LablC3Input.txt. Before beginning to write the program, using NotePad (or any text editor) create a file by this name in the default Folder you would be creating the CodeBlocks project in (or the folder that your IDE reads from). Enter the price 10.98 and the quantity 22 in LablC3Input.txt, save and close the file Output file name should be "Bill.txt". Do not create this file in your Folder Your program should create this file Both input and output files should be stored in the Folder you created the project in when you started CodeBlocks, so no need to specify paths for the files (This Folder will differ depending on the IDE being used) In your program check that the input file opened successfully before reading from it. Program should print out an error message if open not successful When writing the total b to the output file include a label, and the bill should be formatted to show 2 decimal places Before your program exits it should close the input and output files

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!