PROGRAMMING:Making rater
This topic to write a rater. After creating an exam, when you enter the total number of questions and the number of wrong questions, the score will be calculated automatically
There are two classes in the code
1. The parent grade is responsible for grading grades, for example, a: 100-90; B:89-80; C:79-70; D:69-60; F: Below 60
Private members:
Character variable letter --- indicates the grade of achievement, such as' a ',' B ', etc
Single precision floating point variable score --- represents the real fraction
The function calcgrade() --- has no return value and divides the score into levels
Public members:
Setscore function -- set score
Getscore function -- get score
Getletter function --- get grade
2. Subclass test inherits grade to create an exam
Private members:
The variable numquestions --- represents the total number of questions
The variable pointseach --- represents the score of each question
The variable nummissed () --- indicates the number of wrong questions
Public members:
Constructor, used to initialize the total number of test questions and wrong questions
### Input format:
Total questions
Number of wrong questions
###Output format:
The score is
The grade is
###Input example:
Here is a set of inputs. For example:
```in
twelve
three
```
###Output example:
The corresponding output is given here. For example:
```out
The score is:75.00
The grade is:C
```
answer:If there is no answer, please comment
This topic to write a rater. After the exam is created, when the total number of questions and the number of wrong questions are entered, the score will be calculated automatically. There are two categories in the code
1. The parent grade is responsible for grading grades, for example, a: 100-90; B:89-80; C:79-70; D:69-60; F: Private members with score lower than 60: character variable letter --- indicates the grade of the score, such as' a ','b', single precision floating-point variable score --- indicates the real score function calcgrade() -- has no return value, and divides the score into grades. Public members: setscore function --- set score function --- get score function --- get score function --- get score level
2. Subclass test public inheritance grade, used to create private members of the test: variable numquestions --- represents the total number of questions, variable pointseach --- represents the score of each question, variable nummissed() --- represents the number of wrong questions, public member: constructor, used to initialize the total number of questions and wrong questions
There are two classes in the code
1. The parent grade is responsible for grading grades, for example, a: 100-90; B:89-80; C:79-70; D:69-60; F: Below 60
Private members:
Character variable letter --- indicates the grade of achievement, such as' a ',' B ', etc
Single precision floating point variable score --- represents the real fraction
The function calcgrade() --- has no return value and divides the score into levels
Public members:
Setscore function -- set score
Getscore function -- get score
Getletter function --- get grade
2. Subclass test inherits grade to create an exam
Private members:
The variable numquestions --- represents the total number of questions
The variable pointseach --- represents the score of each question
The variable nummissed () --- indicates the number of wrong questions
Public members:
Constructor, used to initialize the total number of test questions and wrong questions
### Input format:
Total questions
Number of wrong questions
###Output format:
The score is
The grade is
###Input example:
Here is a set of inputs. For example:
```in
twelve
three
```
###Output example:
The corresponding output is given here. For example:
```out
The score is:75.00
The grade is:C
```
answer:If there is no answer, please comment
This topic to write a rater. After the exam is created, when the total number of questions and the number of wrong questions are entered, the score will be calculated automatically. There are two categories in the code
1. The parent grade is responsible for grading grades, for example, a: 100-90; B:89-80; C:79-70; D:69-60; F: Private members with score lower than 60: character variable letter --- indicates the grade of the score, such as' a ','b', single precision floating-point variable score --- indicates the real score function calcgrade() -- has no return value, and divides the score into grades. Public members: setscore function --- set score function --- get score function --- get score function --- get score level
2. Subclass test public inheritance grade, used to create private members of the test: variable numquestions --- represents the total number of questions, variable pointseach --- represents the score of each question, variable nummissed() --- represents the number of wrong questions, public member: constructor, used to initialize the total number of questions and wrong questions