Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1.1 Create a class to model a student. This class should be named Student. A Student has the following attributes: first name. surname. student

image text in transcribed

Task 1.1 Create a class to model a student. This class should be named Student. A Student has the following attributes: first name. surname. student number. For now, use an empty constructor for Student objects Your Student class should support the following operations: Get first name - returns the first name of a Student. Get surname returns the surname of a Student. 1 Get student number - returns the student number of a Student. Set first name - sets the first name of a Student. Set surname - sets the surname of a Student. Set student number - sets the student number of a Student Get full name return the concatenation of the first name and the surname of a Student. To string - returns a string indicating the various data associated with the Student. An example returned String might look like Name : Troy Astarte. StdNo: 101095 Create a Test class which is used to test the implementation of the Student class. The Test class will have a main method. In the main method, you should create a Student or two and call the various methods to demonstrate the implementation of the Student class works correctly. Note: we never instantiate the Test class - it is simply the "driver for the program. This class constructs and manipulates Student objects. Likewise we never run the Student class. Note also: Eclipse may require you to add an @Override comment before your To String method. This is fine. Task 1.2 Your task is to implement a constructor method for the Student class. The constructor will take first name, surname, and student number as arguments. O Task 1.3 Extend your Student class to additionally store a coursework mark and an exam mark (out of 100). Add a method named averageMark which will compute and return an average mark for the student. Assume coursework and exam are weighted equallythe average should be the sum of the two marks divided by 2. Watch out for integer division: the method should return a double because it is possible this calculation will not result in an integer. Test your implementation by calling these methods from your Main method in the Test class. Task 1.4 In your main method create an array that holds three different Student objects

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 Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

Explain key ideas of workplace learning

Answered: 1 week ago

Question

Lo6 Identify several management development methods.

Answered: 1 week ago