C++ coding use the ones here #include //atoi #include //strtok #include #include
Posted: Mon Jun 06, 2022 1:17 pm
C++ coding
use the ones here
#include <stdlib.h>//atoi
#include <string.h>//strtok
#include <iostream>
#include <fstream>
#include <string>
and must be used
using namespace std;
The ultimate goal of this topic is to complete a simple score calculation system. Consider a gradetxt file that stores a set of (non- unique) teaching assistants for testing. Examples of content are as follows: 4;3; John;84:75:79; Mary:92:86:91; Lisa;50;70:61; Bob:90:99;93; The above example represents a total of 4 students, and each student's corresponding name has 3 test scores, and each score ranges from 0 to 100; the first student John's three test scores are 84, 75, and 79. The second student Mary's three test scores were 92, 86 and 91. The third student, Lisa, has three test scores of 50, 70, and 61. The fourth student, Bob, has three test scores of 90, 99, and 93. The detailed format of the grade.txt file is defined as follows. First, numbers are separated by semicolons. Among them, the first column (::) of the grade.txt file stores a total of 1 student and n exam results in the class. Then, each column starting from the second column of grade.txt file will have a number between 0 and 100 to represent 1 test score. Q1 (30%), write a program that can read the gradetxt file that conforms to the above format, and then let the user input a name, when the program executes the above example of the assessment, the execution screen will print all the test scores corresponding to the student's name from high to high Arrange them to the lowest level, and calculate the average of the test scores (rounded to the nearest whole number). If there is no corresponding student, it will display, No such student. Please type a name: Mary 92;91;86; Avg: 90
Posted: Mon Jun 06, 2022 1:17 pm
C++ coding
use the ones here
#include <stdlib.h>//atoi
#include <string.h>//strtok
#include <iostream>
#include <fstream>
#include <string>
and must be used
using namespace std;
The ultimate goal of this topic is to complete a simple score calculation system. Consider a gradetxt file that stores a set of (non- unique) teaching assistants for testing. Examples of content are as follows: 4;3; John;84:75:79; Mary:92:86:91; Lisa;50;70:61; Bob:90:99;93; The above example represents a total of 4 students, and each student's corresponding name has 3 test scores, and each score ranges from 0 to 100; the first student John's three test scores are 84, 75, and 79. The second student Mary's three test scores were 92, 86 and 91. The third student, Lisa, has three test scores of 50, 70, and 61. The fourth student, Bob, has three test scores of 90, 99, and 93. The detailed format of the grade.txt file is defined as follows. First, numbers are separated by semicolons. Among them, the first column (::) of the grade.txt file stores a total of 1 student and n exam results in the class. Then, each column starting from the second column of grade.txt file will have a number between 0 and 100 to represent 1 test score. Q1 (30%), write a program that can read the gradetxt file that conforms to the above format, and then let the user input a name, when the program executes the above example of the assessment, the execution screen will print all the test scores corresponding to the student's name from high to high Arrange them to the lowest level, and calculate the average of the test scores (rounded to the nearest whole number). If there is no corresponding student, it will display, No such student. Please type a name: Mary 92;91;86; Avg: 90
use the ones here
#include <stdlib.h>//atoi
#include <string.h>//strtok
#include <iostream>
#include <fstream>
#include <string>
and must be used
using namespace std;
The ultimate goal of this topic is to complete a simple score calculation system. Consider a gradetxt file that stores a set of (non- unique) teaching assistants for testing. Examples of content are as follows: 4;3; John;84:75:79; Mary:92:86:91; Lisa;50;70:61; Bob:90:99;93; The above example represents a total of 4 students, and each student's corresponding name has 3 test scores, and each score ranges from 0 to 100; the first student John's three test scores are 84, 75, and 79. The second student Mary's three test scores were 92, 86 and 91. The third student, Lisa, has three test scores of 50, 70, and 61. The fourth student, Bob, has three test scores of 90, 99, and 93. The detailed format of the grade.txt file is defined as follows. First, numbers are separated by semicolons. Among them, the first column (::) of the grade.txt file stores a total of 1 student and n exam results in the class. Then, each column starting from the second column of grade.txt file will have a number between 0 and 100 to represent 1 test score. Q1 (30%), write a program that can read the gradetxt file that conforms to the above format, and then let the user input a name, when the program executes the above example of the assessment, the execution screen will print all the test scores corresponding to the student's name from high to high Arrange them to the lowest level, and calculate the average of the test scores (rounded to the nearest whole number). If there is no corresponding student, it will display, No such student. Please type a name: Mary 92;91;86; Avg: 90