Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

To simplify this problem (as manyrestaurants do), each different pizza order wil

ID: 3614054 • Letter: T

Question

To simplify this problem (as manyrestaurants do), each different pizza order will be given a number(starting from 0) and each of these orders will have a price. Yourprogram will read in this information from a file named“pizza.txt” and then use it to determine the prices ofdifferent orders of pizza. The information for these orders willALSO be in the file. The specifications for the file format aregiven below.

InputSpecification

1. The first line of the input file willcontain a single positive integer, n (n < 100),specifying the number of different pizza orders for PizzaHut.

2. The next n lines will eachcontain one positive real number specifying the price for thatcorresponding pizza. (The first line will have the price for pizza0, the next line for pizza 1, etc.)

3. The following line will contain a singlepositive integer k (k < 50) representing thenumber of orders you have to evaluate.

4. The next k lines will containinformation about each of the k orders with one order perline.

5. Each of these lines will containn non-negative integers, representing how many of thosepizzas, respectively are in the order. (For example, if n=5 and theline contains the values 0 0 6 0 9, then the order contains 6slices of pizza #2 and 9 slices of pizza #4.)

OutputSpecification

For each of the k test cases,output a line with the following format:

where X is the test case number (starting with 1), andYY.YY is the price of the pizza displayed with exactly 2 digitsafter the decimal. (Note: The price may exceed 100 dollars, so YYsimply represents a dollar amount and not the exact number ofdigits in that dollar amount.

5

3.00

3.50

4.50

5.00

6.00

3

1 1 1 1 1

0 0 2 1 6

1 0 3 2 3

Sample Output (Corresponding to Sample InputFile)

On day 1, you will spend $22.00 at Pizza Hut.

On day 2, you will spend $50.00 at Pizza Hut.

On day 3, you will spend $44.50 at Pizza Hut.

Restrictions

Program must compile and run usingDevC++.

Explanation / Answer

please rate - thanks #include #include int main() {FILE *file; int i,n,k,j,num; double price[100],total; file = fopen("pizza.txt","r"); if(file==NULL)     {printf("Error opening pizza.txt! ");      getch();      return 0;      } fscanf(file,"%d",&n); for(i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote