Write a computer program, in C++, that takes in a file and uses functions and ar
ID: 3625831 • Letter: W
Question
Write a computer program, in C++, that takes in a file and uses functions and arrays. The file will have 10 names, one per line. The line will also have a final score, 3 regular scores, and an identification number(4 digits). The program then will create an output file. In the output file, there will be listed on each line, the name, identification number, 3 regular scores, final score, total score(2 decimals), and a letter score (10 point scale: 90-100 is an A, 80-89 is a B, 70-79 is a C, 60-69 is a D, less than 60 is an F). The total score will be solved by [(75% * final score) plus (25% * average of 3 regular scores)]. The program will also print out the number of names, the highest and lowest total score, the average of the total scores, and the indentifaction number and total score for each name with a <, >, or = comparing each names total score to the average total score.Explanation / Answer
Unfortunately I did not have enough time to write up a detailed program, since there are only 18 min remaining, but here is a general gist that u can use to help you. // input/output test file #include // used for cin and cout #include // used for ifstream and ofstream #include // used for string support #include // double check this...I am pretty sure this is used for decimal placing with setw() and such using namespace std; // used for std:: abbreviations #define INFILENAME "in_file_name.txt" #define OUTFILENAME "out_file_name.txt" int main() { // used for input stream from reading file ifstream inFile(INFILENAME); // used for output stream for writing file ofstream outFile(OUTFILENAME); for (int i = 0; i < 10; i++) { // In here you want to do all of your input and output // operations using inFile and outFile // use ints and strings // int testScore = 0; // e.g. inFile >> testScore // testScore += 10; // outFileRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.