Application to define a Java class called Course

20.00 $ 10.00 $

Categories: ,

Description

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 in to 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 constructo r simply assigns the received values to their corresponding attributes
  5. An overridden toString() method that returns the name of the Java class (i.e. Course) and the course code assigned to the class object The application need to extend the Course class into two other Java classes named:
  6. FlexPathCourse
  7. GuidedPathCourse

The FlexPathCourse class adds the following members:

  1. optionalResources attribute – a string field for the optional resources for a flexpath course
  2. Parameterized constructor with the three par ameters of code, creditHours, and title. The constructor simply assigns the received values to their corresponding attributes
  3. An overridden toString() method that returns the name of the Java class (i.e. FlexPathCourse) and the course code assigned to the class object The GuidedPathCourse class adds the following members:
  4. duration attribute – an int field for the duration of a guidedpath course
  5. requiredResources attribute – a string field for the required resources for a guidedpath course
  6. Parameterized cons tructor with the three parameters of code, creditHours, and title. The constructor simply assigns the received values to their corresponding attributes
  7. An overridden toString() method that returns the name of the Java class (i.e. GuidedPathCourse) and the course code assigned to the 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: