From 77b7fb68332602bf4d90213fd8fe19ea28c0e745 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 29 Aug 2022 22:54:40 -0500 Subject: [PATCH] Added Bus and modified Vehicle Noises --- src/VehicleNoises.java | 3 ++ src/model/Bus.java | 66 ++++++++++++++++++++++++++++++++++++++++++ src/module-info.java | 3 -- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 src/model/Bus.java delete mode 100644 src/module-info.java diff --git a/src/VehicleNoises.java b/src/VehicleNoises.java index 5c0589d..e47fef9 100644 --- a/src/VehicleNoises.java +++ b/src/VehicleNoises.java @@ -53,6 +53,9 @@ public static void main(String[] args) { Unicycle myUnicycle = new Unicycle("Red",false,25); System.out.println(myUnicycle.makeNoise()); + + Bus SchoolBus = new Bus(60, true, true); + System.out.println(SchoolBus.makeNoise()); } diff --git a/src/model/Bus.java b/src/model/Bus.java new file mode 100644 index 0000000..7d43638 --- /dev/null +++ b/src/model/Bus.java @@ -0,0 +1,66 @@ +package model; + +/** + * @author Joe Shilkaitis - jshilkaitis + * CIS175 - Fall 2022 + * Aug 29, 2022 + */ +public class Bus { + int seats; + boolean schoolBus; + boolean flatNose; + + public Bus(int seats, boolean schoolBus, boolean flatNose) { + super(); + this.seats = seats; + this.schoolBus = schoolBus; + this.flatNose = flatNose; + } + + public String makeNoise() { + return "BBRRRRMMM"; + } + + /** + * @return the seats + */ + public int getSeats() { + return seats; + } + + /** + * @param seats the seats to set + */ + public void setSeats(int seats) { + this.seats = seats; + } + + /** + * @return the schoolBus + */ + public boolean isSchoolBus() { + return schoolBus; + } + + /** + * @param schoolBus the schoolBus to set + */ + public void setSchoolBus(boolean schoolBus) { + this.schoolBus = schoolBus; + } + + /** + * @return the flatNose + */ + public boolean isFlatNose() { + return flatNose; + } + + /** + * @param flatNose the flatNose to set + */ + public void setFlatNose(boolean flatNose) { + this.flatNose = flatNose; + } + +} diff --git a/src/module-info.java b/src/module-info.java deleted file mode 100644 index 9f6268f..0000000 --- a/src/module-info.java +++ /dev/null @@ -1,3 +0,0 @@ -module Vehicles202202 { - exports model; -} \ No newline at end of file