Answer to Question #210012 in C++ for ASAP

Question #210012

Topic: Files and Streams


Codes discussed will be posted here. Write your conclusion on the File stream discussion. 


File name: "Ch5_EOFControlledLoop.cpp"


Given problem and code: Please use the link below

-->>https://drive.google.com/file/d/1iDtEPjk5xGcSKpFmlM4LQym-VFp8ptBz/view?usp=sharing


*Note: Need the proper codes

*Note need proper codes and conclusion on how its done and about the results. And please give the proper solution and explanation.

*Note: Give your conclusion at the end explain why you think the result turned that way and try not to modify, but if you need to modify it please do so. Based it on File and Stream topics


1
Expert's answer
2021-06-25T16:06:14-0400

Sample Run:

// Input File
Steve Gill 89
Rita Johnson 91.5
Randy Brown 85.5
Seema Arora 76.5
Samir Mann 73
Samantha McCoy 88.5
// Outpit File
Steve       Gill        89.00 B
Rita        Johnson     91.50 A
Randy       Brown       85.50 B
Seema       Arora       76.50 C
Samir       Mann        73.00 C
Samantha    McCoy       88.50 B

Class Average 84.00

The preceding program works as follows. The statements in Lines 8 to 13 declare and initialize variables needed by the program. The statements in Lines 14 and 15 declares 'inFile' to be an 'ifstream' variable and 'outFile' to be an 'ofstream' variable. The statement in Line 16 opens the input file using the variable 'inFile'. If the input file does not exist, the statements in Lines 17 to 21 output an appropriate message and terminate the program. The statement in Line 23 sets the output of floating-point numbers to two decimal places in a fixed form with trailing zeros.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS