ISM3255 Assignment 8 Solved

20.00 $

Category:

Description

5/5 - (1 vote)
Similar to the last assignment, in this assignment, you will create FOUR classes:

1-      A MainClass

2-      A Parent (base) Class

3-      A Child class (subclass1)

4-      A second Child class (Subclass2)

As a group, choose any entity/concept expect the two examples below) that can be modeled as a Parent class and two different subclasses.

e.g.1: Student Example from the class lecture

·         Parent: Student

·         Child 1: Grad student

·         Child 2 Undergrad student

e.g.2: Vehicle Example from ASG7

·         Parent: Vehicle

·         Child 1: Car

·         Child 2: Plane

Define the parent and two subclasses for it as follow.

You Parent Class should have:

1.       One meaningful attribute which will be inherited by both children (e.g. attributes ID for student or color for vehicle)

2.       One parameterized constructor

3.       One meaningful method which is inherited by both children (e.g. Move() for vehicle)

Hint: don’t forget to compile and test your code before moving on.

Each child class should

1-      Inherits the parent’s attribute

2-      Has one specific attribute which is not included in the other child (e.g wingspan in plane class)

3-      Inherits and extends the parent’s constructor (see how we did it in your ASG7)

4-      Overrides the parent’s method to do a (slightly) different task as the parent’s method and the other child’s method (e.g. driving for a car and flying for a plane instead of moving for a vehicle)

Once you have designed your parent and children classes, write a MainClass with a main method. Your main method should:

Instantiate an object of each child class, call the method for each child object, and show the outputs. Hint: The outputs should be different since the overridden methods are different.

Instructions for Submission

1.      Your main class should start with these two lines:
a.       //Group Number: <your group number
b.      //PRESENT Members
2.      Save your main class as A8_yourGroupNumber.cs.
3.      Submit all FOUR classes that you created as attachments using the E-Learning Assignment tool.

Not following the instruction will result in losing some of your assignment points

  • ASG08.zip