Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Extending Java Classes and Overriding Their Methods In this assessment, you will design and code a Java console application that defines a class, extends it

image text in transcribed

image text in transcribed

image text in transcribed

Extending Java Classes and Overriding Their Methods In this assessment, you will design and code a Java console application that defines a class, extends it into two other classes, overrides the toString) for all three classes, instantiates the classes into three objects, invokes the toString) on these objects, and prints out the return value of each toString() invocation. You can use either the Toolwire environment or your local Java development environment to complete this assignment. The requirements of this application are as follows. The application is to define a Java class called Course. The Course class has the following members 1. code attribute - a string field to store the course code (e.g. IT4789) 2. creditHours attribute an int field to store the credit hours of the course (e.g. 3) 3. title attribute a string field to store the title of the course (e.g. Mobile Cloud Computing Application Development) 4. Parameterized constructor with the three parameters of code, creditHours, and title. The constructor simply assigns the received values to their corresponding attributes An overridden toString) method that returns the name of the Java class (i.e. Course) and the course code assigned to the class object 5. The application need to extend the Course class into two other Java classes named 1. FlexPathCourse 2. GuidedPathCourse The FlexPathCourse class adds the following members 1. optionalResources attribute - a string field for the optional resources for a flexpath course Parameterized constructor with the three parameters of code, creditHours, and title The constructor simply assigns the received values to their corresponding attributes 2. 3. An overridden toString) method that retums the name of the Java class (i.e. FlexPathCourse) and the course code assigned to the class object duration attribute - an int field for the duration of a guidedpath course guidedpath course The constructor simply assigns the received values to their cormesponding attributes (i.e. GuidedPathCourse) and the course code assigned to the class The GuidedPathCourse class adds the following members 1. 2. requiredResources attribute - a string field for the required resources for a 3. Parameterized constructor with the three parameters of code, creditHours, and title 4. An overridden toString) method that returns the name of the Java class object The application will then instantiates three objects from the Course, FlexPathCourse, and GuidedPathCourse and invokes their corresponding toString) methods Use these attribute values when instantiating the three classes to test your application

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions

Question

How can you defend against SQL injection attacks?

Answered: 1 week ago

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago