Question: Main.java Student.java This project contains a Student class and a Main class to test the Student class. Update the Student class as follows: 1. Complete

 Main.java Student.java This project contains a Student class and a Main

Main.java

class to test the Student class. Update the Student class as follows:

Student.java

1. Complete the Student constructor. 2. Provide setters and getters for all

This project contains a Student class and a Main class to test the Student class. Update the Student class as follows: 1. Complete the Student constructor. 2. Provide setters and getters for all of the Student attributes. Setters should take a single parameter of the correct type to apply to the proper attribute, and getters take no parameters and return the proper attribute. Method names should be getAttributeName and setAttributeName. Add appropriate documentation to all these setters and getters. In Eclipse, if you highlight a method name and choose Source / Generate Element Comment ( Alt+Shift+] ), Eclipse adds a documentation comment: /** @tags... */ to the top of the method, and you just fill in the method comment and tagged information. This is the information that shows up in the Javadoc documentation when you generate it. The constructor has an example of complete documentation. 3. Complete the toString method. This method returns a string version of a Student object in the form: Name: Brown, David ID: 123456 Birthdate: 1962-10-25 Note the titles on each line and the alignment of the data. 4. Complete the compare to method. This method compares Student surnames first, then forenames if the surnames match, then the ID if the forenames match as well. Thus Brown, David, 111111 comes before Brown, David, 999999 Hint: Java string and integer comparisons differ. Check the Java API on how to do those comparisons. 5. Add testing for all these methods to the Main class. Generate javadoc for these classes using Eclipse. 1 package cp213; 2 3 import java.time. LocalDate; 4. 50 ** 6 * Tests the Student class. 7 8 * @author 9 * @version 2022-01-17 19 */ 11 public class Main { 12 130 public static void main(String[] args) { 14 final String line = "." ".repeat (40); 15 int id = 123456; 16 String surname = "Brown"; 17 String forename = "David"; 18 LocalDate birthDate = LocalDate.parse("1962-10-25"); 19 Student student = new Student(/* parameters here */); 20 System.out.println("New Student:"); 21 System.out.println(student); 22 System.out.println(line); 23 System.out.println("Test Getters"); 24 25 // call getters here 26 27 System.out.println(line); 28 System.out.println("Test Setters"); 29 30 // call setters here 31 | 32 System.out.println("Updated Student:"); 33 System.out.println(student); 34 System.out.println(line); 35 System.out.println("Test compareTo"); 36 37 // create new Students - call comparisons here 38 } 39 40 } 41 1 package cp213; 3 import java.time. LocalDate; 5/** + Student class definition. 7. + author + version 2922-01-17 2 public class Student implements Comparable { // Attributes private LocalDate hirthate - null; S private String farena - ""; private int id - e; private String surname Instantiates a Student object. 2 1 *paran id student ID number * Oparan surname student surname + Oparan forename name of fara paran birth ate birthDate in 'YYYY-MM-DD format public Student(* parameters here ) { 11 assign attributes here 3 2 3 return; } - (non axader) + @sce java.lang.ObjectitoString() Creates a formatted string of student data. @Override public String tastring() { String string - 1/ your code here 2 3 return string: } 1 (non-Maxador) + @sce java.lang.Comparable compare to java.lang.Object) @Override public int compare to final Student target) { int result - 5 // your code here return result; } // getters and setters defined here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!