Answered step by step
Verified Expert Solution
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, ie the price of all items
dataIn.opentransactiondat"; This opens the file.
dataOut.openbillout";
Fill in the appropriate code in the blank below
setprecision 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 ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started