Review Assignment Due Date Open in Visual Studio Code

Assignment 1

Creating a simple JAVA application to implement a Inheritance and Polymorphism.

Dear students,

In this assignment, you need to submit you work to implement a project which demonstrates your knowledge on mainly inheritance, polymorphism and abstraction.

Task Related - List of the required types

  • Vehicle class
  • Car class (a subclass of the Account)
  • Motorcycle class (a subclass of the Account)
  • Main

Task Related - Vehicle class (20 %)

It should have the following fields and the methods:

Fields:

  • id - (String - autogenerated)
  • brand - (String)
  • year - (Integer)

Methods:

  • a parametrized constructor to initialize fields
  • a getter method for each field
  • a setter method for brand and year
  • an abstract method named startEngine()

Task Related - Car class (20 %)

It should have the following fields and the methods:

Fields:

  • numberOfSeats - (Integer)

Methods:

  • a parametrized constructor that initializes the numberOfSeats field with the value 5
  • a parametrized constructor that initializes all the fields with the input parameters
  • getter and setter methods for the field
  • overrriden startEngine() method that prints "Car engine starts..."

Task Related - Motorcycle class (20 %)

It should have the following fields and the methods:

Fields:

  • hasSidecar - (Boolean)

Methods:

  • a parametrized constructor that initializes the hasSideCar field with the value false
  • a parametrized constructor that initializes all the fields with the input parameters
  • getter and setter methods for the field
  • overrriden startEngine() method that prints "Motorcycle engine starts..."

Task Related - Exception handling (10 %)

  • Please, carefully follow the instructions above.
  • Your program should properly enforce encapsulation, inheritance, abstraction and polymorphism.
  • Your program should prevent invalid operations using proper exceptions and exception handling. Some of them are the following:
    • number of numberOfSeats cannot be less than 1
    • year cannot be in the future, etc.

Task Related - Testing all together (25 %)

You will need to define a Main class which demonstrates all the functionality of your program. However, it is strongly encouraged to test each class and each method as soon as they are completed to have less errors and easy debugging in the end.

Define a method race()in the Main class that accepts and array of Vehicles and simulates a race. In the method call startEngine() of each vehicle in the array to print the relevant message.

Create a JavaDoc comment and explain the inheritance and polymorphism principles in the application.

When you compile, make sure your .class files are totally isolated from the rest and are never commited and pushed.

Task Related - Class diagrams (5 %)

Draw the class diagrams including all the relations among the classes. Add the image(s) to the project folder so that they are submitted to the repository as well. You may use any tool to draw the diagrams. Make sure you submit image format (.jpg or .png).

Submission related: (5%)

  • Record a short video not exceeding 5 minutes to explain the code as well as the way users can interact with the end product
      Show:
    • main blocks of the code base
    • each of the features mentioned above
  • Upload the video to YouTube and share the link by adding it to your README.md file as the first line (Note: do not empty the READMY.md file).
  • Submissions without a video recording will not be graded.

Important notes:

- Codes that do not compile and run for any reason will not be graded. Test properly before you submit your work.
- Please, also refer to the course syllabus about the assignments.
- Each completed feature must be commited and pushed works submitted in just one or two commits are not acceptable.
- This assignment will give you 10 % of the overall.