Question: URGENT - JAVA PROGRAMMING QUESTION ( I'm beginner in java :) Please put the code and explain it. and please write the java code for
URGENT - JAVA PROGRAMMING QUESTION
( I'm beginner in java :) Please put the code and explain it. and please write the java code for this with the internal documentation using javadoc notation. thank you)


--Below is the Student class from assign#2:--
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Student {
private String firstname;
private String surname;
private long studentNumber;
private String address;
private double quizPointAverage;
private String loginId;
private List
public Student(String firstname,String surname,long studentNumber){
this.firstname = firstname;
this.surname = surname;
this.studentNumber = studentNumber;
this.loginId = loginIdGenerator();//construction time by the class
}
private String loginIdGenerator(){
char f = firstname.toUpperCase().charAt(0);
char s = surname.toUpperCase().charAt(0);
Random r = new Random();
long l = 10000+r.nextInt(10000);
String id =""+ f+s+l;//concatenate f , s and l
return id;
}
public void setName(String firstname,String surname,long studentNumber){
this.firstname = firstname;
this.surname = surname;
}
public String getName(){
return firstname+","+surname;
}
public long getStudentNumber(){
return this.studentNumber;
}
public String getLoginId(){
return this.loginId;
}
public String getInfo(){
return getName()+"("+this.loginId+","+this.studentNumber+")";
}
public void setAddress(String number,String street,String city,String province,String postalCode){
this.address = number+" "+street+" "+city+" "+province+" "+postalCode;
}
public String getAddress(){
return this.address;
}
public void addQuiz(double quiz){
if(this.quiz==null)
{
this.quiz = new ArrayList
}
this.quiz.add(quiz);
this.quizPointAverage = calculateQPAverage();
}
private double calculateQPAverage(){
double total = 0;
for(double d: this.quiz)
{
total +=d*10;
}
double allTotal = 10*this.quiz.size();
return total/allTotal;
}
public double getQuizAverage(){
return this.quizPointAverage;
}
@Override
public String toString() {
return "Student [firstname=" + firstname + ", surname=" + surname + ", studentNumber=" + studentNumber
+ ", address=" + address + ", quizPointAverage=" + quizPointAverage + ", loginId=" + loginId + "]";
}
}
Program: Develop a program that tests an object of the class College that has Student objects. The program should support the following operations: . 0 . . Create a College object. Adding a new student to the college. Looking up an existing student based on the student number. Deleting a student from the college using the student number. Adding the grade point value and credit units earned for a course taken by an existing student. Retrieving the login id for an existing student (using the student number to look up the student). Finding a student with the college's highest GPA. . About your implementation: . o o Once the user quits the program, all the data on the College is lost. You should create the following three classes: The Student class from assignment # 2 (with the specifications given there): each Student object stores the name, student number (given by the system at creation), address, and the total grade points for a student plus the number of credits taken so far. You may need to modify your Student public interface from assignment #2 (or fix the class if it was not correct). The College class with the list of all students (use an ArrayList of Student objects). The College Tester class with a main method which creates a College object (which manipulates Student objects) based on user input. Modularize the main program. In this CollegeTester you are to ask the user for input using the Scanner class. Print the possible commands in a 'menu' for the user to know what the possible commands are. different commands from the user to manipulate the College. Your program is to handle erroneous data. Display appropriate error messages. For example, Check whether the user enters a valid command. o . . o o O O Determine if the student (based on the student number) is indeed in the college for operations such adding a course for the student. Check whether the student number is valid input (in the sense of it being numeric and greater than or equal to the smallest possible student number). A student name must have exactly two names (words) separated by at least one blank: check that the user enters such a student name. The address is "free formatted so be careful when using the methods nextIntextDouble and nextLine from the Scanner class. Comment your classes and methods appropriately using the Javadoc notation. A document that explains how to write the comments is under Marking Scheme [30] College Class design and implementation O [10] Constructor And Private instance variable [20] Public Methods [5] Adding a Student, parameter is Student object, and Deleting a Student given a student number. [5] Finding a student given a student number. [5] Finding a student with highest GPA. [5] to String method. O O O [50] College Tester O O O [35] functionality Adding a new Student to the College and deleting a student from the college. Looking up an existing student o Adding the GPA for a course for a specific student Retrieving the login ID for a specific student Finding a student with the highest GPA [10] Handle Errors Check that user entered a valid command Valid student number consisting of 8 digits Student name must have two names separated by space [5] Readability of output produced by College Tester O O O [10] Documentation: Javadoc for all the methods headers, purpose of the program, inline comments [10] Programming Style: Meaningful variable names and constants following the conventions, consistent indentation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
