Question: Complete the following PHP assignment: Vehicle Class (Abstract) Create an abstract class called Vehicle with the following fields and abstract methods: Fields: engineState, speed, engineSize,

Complete the following PHP assignment:

Vehicle Class (Abstract)

Create an abstract class called Vehicle with the following fields and abstract methods:

Fields: engineState, speed, engineSize, vehicleType

Create setters and getters for these fields.

Create the following abstract methods: startEngine, stopEngine, accelerate, break, showInfo

Car, Plane, Boat Classes (Concrete)

Create standard classes for Car, Plane, Boat that extend the Vehicle class.

Implement all the methods accordingly. (i.e. check if the engine is already ON when a start() method is invoked). Scooter example: public start(){ if ($this->engineState != "ON") { $this->engineState = "ON"; echo "Starting " . $this->getVehicleType() . " engine..."; } else { echo "Engine is already ON"; } public accelerate($newSpeed){ $this->setSpeed($newSpeed); }

HTML Page

Create an HTML page called vehicle.php

Include the classes into the web page

Instantiate three objects (one of each class) and initialize their properties.

Display all information to the browser.

Separate these classes from the Web page.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!