We have following results of a course with exam: 75 of the students who completed this course took the exam. We want to know how well the students did in the examination and are given the scores of 75 students. We want to write a program that summarizes and analyzes the results the following way: 1. Use random number generator Use 5 (Matric/Identification number of only five digits). 2. Input each test result (i.e., raw marks). Display the prompting message “Enter result” each time the program requests another test result. a) You are to enter the raw score and categorize it as follows: i. 90 and above is A ii. 89-80 is B iii. 79-70 is C iv. 69- 60 is D v. 59 and below is E 3. Count the number of test results of each type. 4. Further categorize the result into Pass or Fail (a P or an F) i. All As, Bs, Cs and Ds are under the P category while E is under F category. ii. Next to each matric/identification number is written a P if the student passed the exam or an F if the student failed. 5. Display a summary of the test results indicating the number of students who passed and the number who failed. 6. Program should restrict user from entering invalid marks (char, negative number, above 100 etc.)
this is my uni assingment. i have done the code part but i like to add these 2 code in one-single program. but can not figure out how know how here is the first code
#include <iostream>
using namespace std;
int main()
{
int marks;
int matric;
cout <<"Matric/Identification number of only five digits \n";
cin >> matric;
cout <<"Enter marks \n";
cin >> marks;
if (marks <=50)
{
cout << " Your grade is F \n";
cout << " You fail in the exam";
}
else if (marks >=50 && marks <=59)
{
cout << " Your grade is E" <<endl;
cout << " You pass in the exam" <<endl;
}
else if (marks >=60 && marks <=69)
{
cout << " Your grade is D" <<endl;
cout << " You pass in the exam" <<endl;
}
else if (marks >=70 && marks <=79)
{
cout << " Your grade is C" <<endl;
cout << " You pass in the exam" <<endl;
}
else if (marks >=80 && marks <=89)
{
cout << " Your grade is B" <<endl;
cout << " You pass in the exam" <<endl;
}
else if (marks >=90 && marks <=100)
{
cout << " Your grade is A" <<endl;
cout << " You pass in the exam" <<endl;
}
else if (marks <=-1 && marks >=101)
cout << " Mark doesn't exsit" <<endl;
}
here is another code
#include <iostream>
using namespace std;
int main()
{
int passes = 0;
int failures = 0;
int studentCounter = 1;
int result;
while (studentCounter <=10)
{
cout << "Enter Result";
cin >> result;
if (result >=50)
passes = passes+1;
else
failures = failures+1;
studentCounter = studentCounter + 1;
}
cout << "passed" << passes <<"\nFailed" << failures << endl;
if( failures > 3)
cout <<"Failures not eligible for Engineering " <<endl;
}
SAMPLE
Matric/Identification number of only five digits: 89798
Enter result: 90
mainor you would like to create a menu for the two program? for example, if you enter 1 the first program will be process and if you enter 2 the second program and if you enter any number or key the program will stop? just clarifying itmainthat calls two functions formed from the two currentmains and one class, or astd::pair, to track the students and their marks. Other than that, crack the text, do some reading, and get to it. Come back when you have a question more detailed than I don't know what to do.