Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a class called Student. A student has a name A student has an address A student has a unique student number that is given

image text in transcribed
image text in transcribed
Implement a class called Student. A student has a name A student has an address A student has a unique student number that is given by the system' when the student is constructed A student has a login id that can be obtained (you do not need to check for uniqueness of the login id - just follow the rules below on assigning the login id) A student object has totalCredits and totalPoints. When a Student object is created both totalCredits and totalPoint are set to 0. These two values will be changed by the addCourse method. Supply appropriate constructors and public methods for the Student class. Provide the following methods getName getAddress .addCourse (the grade point and the number of credits for the course should be passed as formal parameters). calculateGPA (Student's GPA is calculated by dividing the totalPoints by totalCredits) getStudentNum getLoginld Create a test program (you may use Junit or not) for the Student class. The purpose of a test program is to verify that the class methods have been implemented correctly. A test program calls all the methods and checks that they return the expected results. Make sure to include the following testing: o Create more than one student and check the studentID's. Add a few courses to a student and make sure the getGPA method returns the correct value. About Your Implementation: Comment your Student class and the methods appropriately using the Javadoc notation. Every time that a course is added, the grade point value earned (i.e. the grade points) for that course must be passed as an argument as well as the number of credits units for the course. You don't need to keep track of the courses taken. "The Grade Point Average GPA is calculated by taking the grade points a student earned in a given period of time divided by the total number of credits taken." http://www.back2college.com/spa.htm Create two constructors for this class o One constructor needs to takes two strings as arguments. One string will be the student address (which may contain blanks and is free formatted). The other argument is the student name. Assume that every student name consists of exactly two words: the first word is the "first name" and the second word is the "last name" (we are not allowing "middle names"). There can be blanks in the argument of the student name: remove the extra blanks before and after the first and last name. The second constructor takes only the name of the student. The "student number" assigned to the first student created should be 10001. Every time that a student is constructed, the (system) assigned "student number" is one greater than the last constructed student number". "Compute" the login-id as follows (all the letters of the login-id are in lower case): o Make the first letter of the 'login id' the first letter of the "first name" (and remember that the first name" is the first word of the student name, normalized to remove extra blanks). Make the middle part of the 'login id' the first 3 letters of the "last name" if the "last name" has fewer than 3 letters, then use all the letters of the "last name" the last part of the login id consists of the last 2 digits of the student number' i.e. the two least significant digits Examples "April Schauer" with a 'student number' 10001 has a 'login id' asch01 . "Norma Li" with a 'student number' 105345 has a "login id' nli45 ." Brock o "with a 'student number 10005 has a login id boos "Misty Waters with a 'student number 10010 has a 'login id' mwat10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

=+1 Why are local employment laws important to IHRM?

Answered: 1 week ago

Question

=+ Are some laws more important than others? If so, which ones?

Answered: 1 week ago