Question: java PROBLEM 1: Student Success (30 points) For this first problem, you will implement a simple class: the Student class! All the information you should




PROBLEM 1: Student Success (30 points) For this first problem, you will implement a simple class: the Student class! All the information you should need can be found within the description of the Student class (to be created in the file Student.java) and in the UML diagram below. The Student class We always try to put students first! And now we are asking you to as well! Here you will construct the Student class based on the information below. Student Student -studentID: int -firstName: String -preferredName: String -lastName: String +Student (ID: int, firstName: String, lastName: String) +getStudentID(): int +getName(): String +setLastName (lastName: String): void +set PreferredName (preferredName: String): void +toString(): String Description of methods from the Student class: +Student (ID: int, firstName: String, lastName: String) Constructs a student with designated student ID, first name and last name. Preferred name is initially set to be the same as their first name. +get StudentID(): int Returns the integer student ID. +getName(): String Returns a string containing the student's preferred name in the form: "preferred-name last-name" +set Last Name (lastName: String): void Update the last name of a student. +getName(): String Returns a string containing the student's preferred name in the form: "preferred-name last-name" +set Last Name (lastName: String): void Update the last name of a student. +set PreferredName (preferredName: String): void Sets the name that the student would preferred to be called +toString(): String Overrides the existing string representation of the object to be: getName() + " (" + student-id + ")" Student.java New Full Screen $
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
