Professional Documents
Culture Documents
(Finalversion) DeCuoiKi PDF
(Finalversion) DeCuoiKi PDF
GP A check can be written in 1 in 2 ways: (1) return a string (good/not good) or (2) return a
boolean value (true if it is good, false otherwise)
Create a class named hust student inherited from the class student with additional
string attribute school. Methods of hust student include:
A constructor with 4 string parameters: initialize a hust student-object with particular values for its 4 attributes: name, age, school and f aculty. It calls the
constructor of the class student.
A redefined method GP A input to input a GP A value: input one character A, B,
C, D, E or F . If A is entered, assign 5 to GP A. Similarly, if B, C, D, E or F is
entered, assign 4, 3, 2, 1 or 0 to GP A, respectively.
A redefined method GP A check to check if a GP A is good or not good. A
GP A is considered good if it is equal to A or B 2 , and not good otherwise.
Operation of the function main:
Create an array of 10 student pointers.
For each pointer:
Ask users to enter a number 0 or 1, corresponds to hnue student or hust student.
Ask users to enter values for the attributes of a hnue student object(or hust student
object) to temporary variables.
Based on the information entered, initialize an object.
Use f or loops to:
Ask users to enter GP A of 10 student objects.
Print out on the screen the names of 10 students and his/her GP A classification
(good or not good).