Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please code in java PROBLEM 1: Student Success [30 points] For this first problem, you will implement a simple class: the Student class! All the
please code in 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 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 -studentID: int -firstName: String -preferredName: String -lastName: String +Student (ID: int, firstName: String, lastName: String) +get StudentID(): int +getName(): String +setLastName (lastName: String): void +setPreferredName (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. +getStudentID(): int Returns the integer student ID. +getName(): String Returns a string containing the student's preferred name in the form: "preferred-name last-name" +setLastName (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 + ")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