Question
THIS IS ONLY IN C++ PLEASE MAKE IT SIMPLE FOR A BEGINNER. Open a file (as an input file) that already has the following data
THIS IS ONLY IN C++ PLEASE MAKE IT SIMPLE FOR A BEGINNER.
Open a file (as an input file) that already has the following data in it:
a. at least 10 students full names (first name, middle name and last name) with at least 8 test scores(each value between 0 and 100) for each of the students.
2. Reads that data from that input file above and save them into your program using needed arrays(or struct necessary array of that struct)
3. Displays all the data on the screen in a neatly formatted colums.
This is the input file that I already have:
#include
// Defining the constants of the program.
const int NUM_STUDENTS = 10; const int NUM_TEST = 8;
// This section will store the full names of students.
string FN() { string first_name, middle_name, last_name; cout << "Enter first name: "; cin >> first_name; cout << "Enter middle name: "; cin >> middle_name; cout << "Enter last name: "; cin >> last_name; return first_name + " " + middle_name + " " + last_name; } // This section will tell the user to enter the scores of the students with no return to main.
void testSCORE(int scores[NUM_TEST]) { for (int i = 0; i < NUM_TEST; i++) { cout << "Enter score for test " << i + 1 << ": "; cin >> scores[i]; } } //This section will get the ouput of the students names and test scores. int main() { ofstream outfile; outfile.open("DataOutput.txt");
for (int i = 0; i < NUM_STUDENTS; i++) { string name = FN(); int scores[NUM_TEST]; testSCORE(scores);
outfile << name << " "; for (int j = 0; j < NUM_TEST; j++) { outfile << scores[j] << " "; } outfile << endl; }
// Closing the output file. outfile.close();
return 0; }
I now just need assistance with number 2. and 3. above.
Please make this simple and give step by step explanations with comment statements. Please do not use any built in data structures such as vector, list, stack, queue, dequeue, set, map, unordered map, multisite, and etc.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started