Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++ image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions