if the user wants to read the input from a file


If the user wants to read the input from a file, then the output will also go into a different file. If the user wants to read the input interactively, then the output will go to the screen.

Your initial menu will look like the following:

            Menu

<1>      Read data from a file

<2>      Read data interactively

            Enter choice:

Here is a sample input file:

21     25 

30     30 

10     12 

55     60 

-1                               /* this is the flag to end inputting the assignment data */

21     25 

30     30 

10     12 

21     25 

30     30 

Here is another sample input file:

21     25 

30     30 

10     12 

55     60 

-1                                 /* this is the flag to end inputting the assignment data */

21     25 

-1                                 /* this is the flag to end inputting the midterm exam data */

21     25 

30     30 

 

Solution Preview :

Prepared by a verified Expert
Application Programming: if the user wants to read the input from a file
Reference No:- TGS0442116

Now Priced at $15 (50% Discount)

Recommended (94%)

Rated (4.6/5)