Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Please help. Thanks in advance (Objects and classes) Write a Java program to meet the following requirements: I. Define a Student class with the following

Please help. Thanks in advance
image text in transcribed
(Objects and classes) Write a Java program to meet the following requirements: I. Define a Student class with the following 6 private data fields: (10%) An int data field named studentld for the student id (default 0). Two String data fields named firstName and last Name (default "NA"). A String data field named stEmail contains student's email address (default "NA") . . A double data field named totalCredits for the Student total earned credits (default 0). . A Date data field named dateCreated that stores the date when the Student record was created. 2. Implement the following methods for the Student class: (50%) A no-arg constructor with default values mentioned in item 1 above, and initialize dateCreate= new Date0 A constructor with 5 parameters ( studentld, firstname, lastname, email, totalCredits)-assign the parameter values to these 5 data fields and initialize dateCreate- new Date0; . The accesser and mutator methods for totalCredits The accessor method for studenti, firstName, lastName, stEmail, dateCreated. . A method named withdrawCredit that withdraws a specified amount of credit from the Student's totalCredits A method named earnCredit that adds a specified amount of credit to the Student's totalCredits. A print method that prints (1) student's student id, (2) firstname, (3) lastname, (4) email (5) . totalCredit and (6) the date student record was created Write a test program that does the following steps in order (40%) (1) Declare Student Object array to store three transferred students' information which are listed below ( 10%) 3. . Student id: student1 ID: 101, student2 ID: 102, student3 ID: 103 .firstname, lastName, email : you need to assign different name for each student .totalCredit studentl ID: 10, student2 ID: 20, student3 ID: 15 (Hard code the students' information in java source code which means no input from keyboard. Example: Student(101,"John"."May","abc@kean.edu", 10) Student( 102,"Nancy"."Brown", "defa kean.edu",20 ) Student(103."Stacy" "Lin","abed@kean.edu",15); (2) Call earnCredit and withdrawCredit methods for every student. The first student earns 12 credits The 2nd student witdraw 3 credits The 3rd student earns 6 credits and withdraw 2 credits. (10%) (3) Call the print method to display all students information. ( 10%) Find the student who has the highest totalCredit and print this student's information. Note: Use loop statements to find the highest tota!Credit. (10%) (4) How to submit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions