Question
1) In Student.java , create a Student class that will have the following fields/properties and methods: String firstName (5 pts) String lastName (5 pts) String
1) In Student.java, create a Student class that will have the following fields/properties and methods:
- String firstName (5 pts)
- String lastName (5 pts)
- String major (5 pts)
- double gpa (5 pts)
- int numberOfClasses (5 pts) //number of classes the student is currently enrolled in
- boolean attending (5 pts) //indicates if the student is currently classified as "attending classes"
- getter and setter methods for each of the above (12 total -- 6 getters and 6 setters, 5 points each, for 60 points total)
2) In lastname_lab1.java, create one student objects based on your Student class that you created in (1). You may choose what values to use to initialize all 6 fields, but you must use the methods you defined in (1) to set the fields in order to receive full credit for this part of the lab. For full credit, you must also invoke the methods you created in (1) to print out the field values within your lastname_lab1.java file. (10 points)
Note: lastname_lab1.java should have a main() function; Student.java should not, it should just contain the code defining the Student class in accordance with the above requirements.
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