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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Step 1

According to the Bartleby guideline, we are supposed to answer only one question at a time.

Kindly repost the remaining question and mentioned it

 

 

We have to declare the instance variable with storage class called Student 

as we know an instance variable is a variable that is declared in a class, but outside of constructors, methods, or blocks. Instance variables are created when an object is instantiated and are accessible to any constructors, methods, or blocks in the class. Access modifiers can be assigned to instance variables.

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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education