given the following data definition classpublic


Given the following Data Definition Class:

public class Exam {
private static int total;
public static void setTotal(int t) {total = t;}
private int score;
public void setScore (int s) {score = s;}
public double grade () {return 100.0 * score/total;}
}

Using four lines of code:
Create an Exam object
Enter fifty for the total possible points for the exam
Prompt the user for the student's score and put that value into an object
Output the student's grade

 

Solution Preview :

Prepared by a verified Expert
JAVA Programming: given the following data definition classpublic
Reference No:- TGS0484640

Now Priced at $10 (50% Discount)

Recommended (98%)

Rated (4.3/5)