Reading and Writing to a File
Bring in billfile. cpp from the Lab 5 folder.
The code is as fo...
Computers and Technology, 31.03.2021 01:00 arivalen
Reading and Writing to a File
Bring in billfile. cpp from the Lab 5 folder.
The code is as follows:
// 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; // defines an input stream for a data file
ofstream dataOut; // defines an output stream for an output file
int quantity; // contains the amount of items purchased
float itemPrice; //contains the price of each item
float totalBill; //contains the total bill. 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 totalbill.
// Fill in the output statement that prints the total bill,
// with a label, to an output.
return 0;
}
Answers: 2
Computers and Technology, 21.06.2019 16:00
This statement accurately describes how headlines should be placed in business documents.
Answers: 3
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
English, 26.09.2019 02:30
Social Studies, 26.09.2019 02:30
Social Studies, 26.09.2019 02:30
Geography, 26.09.2019 02:30
Mathematics, 26.09.2019 02:30
History, 26.09.2019 02:30
Social Studies, 26.09.2019 02:30