Suppose that you have the following statements: (10) ofstream outfile; int numOfJuiceBottlesSold = 35; double costOfaJuiceBottle = 0.75; double revenue; Use this information and write C11 statements...


Suppose that you have the following statements: (10)


ofstream outfile;


int numOfJuiceBottlesSold = 35;


double costOfaJuiceBottle = 0.75;


double revenue;


Use this information and write C11 statements to do the following:


a. Open the file sales.dat using the variable outfile.


b. Write the statement to format the output in the outfile to two decimal places in fixed form.


c. Calculate and store the revenue generated by selling the juice bottles in the variable revenue.


d. Write the values of the variables numOfJuiceBottlesSold and costOfaJuiceBottle, and revenue in the file sales.dat.


e. Write a statement to close the file sales.dat




May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here