Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/ / This program will read in the quantity of a particular item and its price. / / It will then print out the total

// This program will read in the quantity of a particular item and its price.
// It will then print out the total price.
// The input will come from a data file and the output will go to
// an output file.
// PLACE YOUR NAME HERE
#include
#include
using namespace std;
int main()
{
ifstream dataIn;
ofstream dataOut;
int quantity;
float itemPrice;
float
totalBill;
// defines an input stream for a data file
// defines an output stream for an output file
// contains the amount of items purchased
// contains the price of each item
// contains the total bill, i.e. the price of all items
dataIn.open("transaction.dat"); // This opens the file.
dataOut.open("bill.out");
// Fill in the appropriate code in the blank below
<< setprecision(2)<< fixed << showpoint;
// formatted output
// Fill in the input statement that brings in the
// quantity and price of the item
// Fill in the assignment statement that determines the total bill.
// Fill in the output statement that prints the total bill, with a label,
// to an output file
return 0;
}

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_2

Step: 3

blur-text-image_3

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

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions