Skip to content

Latest commit

 

History

History
184 lines (127 loc) · 3.85 KB

File metadata and controls

184 lines (127 loc) · 3.85 KB

University of West Attica

UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS

University of West Attica · Department of Computer Engineering and Informatics


Software Development Methodologies

Classes and Inheritance

Vasileios Evangelos Athanasiou
Student ID: 19390005

GitHub · LinkedIn


Supervision

Supervisor: Georgios Prezerakos, Professor

UNIWA Profile · LinkedIn

Co-supervisor: Angelos Georgoulas, Assistant Professor

Scholar · LinkedIn


Athens, March 2023



INSTALL

Classes and Inheritance

This guide explains how to set up, build, and run the project on your local machine.


1. Prerequisites

Before running the project, ensure the following tools are installed:

  • Java Development Kit (JDK)
    Version 8 or higher is recommended.

  • Text Editor or IDE

    • Text editors: Notepad++, VS Code, Sublime Text
    • IDEs: IntelliJ IDEA, Eclipse, NetBeans
  • Terminal / Command Prompt Used to compile and run Java programs.


2. Setup & Installation

2.1 Project Structure

Organize the project files inside a single directory.
The project should contain at least the following Java files:

Vehicle.java
Car.java
Plane.java
Main.java

Description

File Purpose
Vehicle.java Base class containing shared vehicle attributes
Car.java Derived class representing cars
Plane.java Derived class representing planes
Main.java Entry point of the program containing main()

3. Implementation Checklist

Verify that the classes follow the required specifications.

3.1 Vehicle Class

Must include the following attributes:

  • make
  • model
  • year
  • weight
  • needsMaintenance (default: false)
  • tripsSinceMaintenance (default: 0)

3.2 Car Class

Additional attributes:

  • isDriving
  • horsepower

Required behavior:

  • drive() → starts driving
  • stop() → stops driving and increments tripsSinceMaintenance

3.3 Plane Class

Additional attributes:

  • isFlying
  • wingspan

Required behavior:

  • fly()must be rejected if needsMaintenance is true
  • land() → stops flying and increments tripsSinceMaintenance

Maintenance Logic

  • Cars: require maintenance after 100 trips
  • Planes: require maintenance after 80 trips

4. Compilation

Open a terminal inside the project directory and run:

javac *.java

This compiles all Java source files.


5. Execution

Run the program using:

java Main