Problem 166

Basic Records

Make a class to store information about a student, which should handle a name, a grade classification, and an average.

Create three variables of type Student. Read in values for the three students and print them out again.

Give the average for all three students.

Do not use an array, the next question will have arrays as a modification to this problem. and do not use any loops, the question after next will add looping as a modification.

Enter the first student's name: Esteban
Enter the first student's grade: 12
Enter the first student's average: 79.3

Enter the second student's name: Dave
Enter the second student's grade: 10
Enter the second student's average: 91

Enter the third student's name: Michelle
Enter the third student's grade: 11
Enter the third student's average: 98.6

The names are: Esteban Dave Michelle
The grades are: 12 10 11
The averages are: 79.3 91 98.6

The average for the three students is: 89.633333

◄ 165: Address .toString() 167: A Little Database ►



Adapted from ProgrammingByDoing.com
©2013 Graham Mitchell

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.