Question
A. Create a new project named StudentScores Create a Student class with instance data as follows:student id and the scores for three tests. Provide 2
A. Create a new project named StudentScores
Create a Student class with instance data as follows:student id and the scores for three tests.
Provide 2 constructors as follows:
1) parameter values for all instance data fields
2) parameter for only the student id
Provide a method called setTestScore that accepts two parameters: the test number (1 through 3) and the score. You will need to use 'if' statements to set the score to the proper test.
Also provide a method getTestScore that accepts the test number and returns the appropriate score. You will need to use 'if' statements to get the proper test score.
Provide a method called average that computes and returns the average test score for this student
Create a DisplyInfo method to show student ID, test scores, and average test score.
B. Create a driver program called TestScores.
Create 2 students as follows: ID FC123
ID FC456
Student FC123 is created with the follow three test scores: 100, 80, 94 Student FC456 is created only with the id. Later, call setTestScore with three scores 78, 92, 80
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started