Please help me on these questions on my Java Program Questions 1-7 involve writing a Java storage class called Student that keeps track of a student's first name, last name and the number of credits being taken in a semester.. Write down the declarations for the instance variables.
Please help me on these questions on my Java Program
Questions 1-7 involve writing a Java storage class called Student that keeps track of a student's first name, last name and the number of credits being taken in a semester.. Write down the declarations for the instance variables.
Question 2: Write down the mutator methods for the instance variables. You don't need to check for the passed values other than trimming any String values.
Question 3: Write down a constructor that allows setting all of the instance variables. You can simply call the mutator methods you came up with in question 2.
Question 4: Write down all the accessor methods for the instance variables.
Question 5:
Create a toString() method that will return:
Jane Doe, credits: 12
if Jane Doe is taking 12 credits
Question 6: Rewrite the mutator for the first name, so that if a blank String is passed to this method, the first name is set to "NOFIRST".
Question 7: Rewrite the mutator for the number of credits, so that if a negative value is passed for the credits, credits is set to zero.
Step by step
Solved in 2 steps with 2 images