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.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question

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.

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage