From 97f5e09cba2dffb97170103f51514e3774b7ed4d Mon Sep 17 00:00:00 2001 From: Cameron Mockobee Date: Wed, 30 Aug 2023 19:07:40 -0500 Subject: [PATCH] Added Moped class and updated Vehicle noise --- Vehicle/src/VehicleNoise.java | 5 +++ Vehicle/src/model/Moped.java | 73 +++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Vehicle/src/model/Moped.java diff --git a/Vehicle/src/VehicleNoise.java b/Vehicle/src/VehicleNoise.java index d66a1ed..6ec1243 100644 --- a/Vehicle/src/VehicleNoise.java +++ b/Vehicle/src/VehicleNoise.java @@ -1,5 +1,6 @@ import model.Car; import model.Example; +import model.Moped; import model.Car; import model.Train; @@ -23,6 +24,10 @@ public static void main(String[] args) { // my vehicle noise Car Mustang = new Car(); System.out.println(Mustang.makeNoise()); + + // Moped noise + Moped Honda = new Moped(); + System.out.println(Honda.makeNoise()); } diff --git a/Vehicle/src/model/Moped.java b/Vehicle/src/model/Moped.java new file mode 100644 index 0000000..225f7a7 --- /dev/null +++ b/Vehicle/src/model/Moped.java @@ -0,0 +1,73 @@ +package model; +/** + * Cameron Mockobee - cmockobee1@dmacc.edu + * CIS175 = - Fall 2023 + * Aug 30, 2023 + */ + +public class Moped { + private String name = "Honda"; + private int maxSpeed; + private String color; + + public Moped() { + super(); + } + + /** + * @param name + * @param maxSpeed + * @param color + */ + public Moped(String name, int maxSpeed, String color) { + this.name = name; + this.maxSpeed = maxSpeed; + this.color = color; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the maxSpeed + */ + public int getMaxSpeed() { + return maxSpeed; + } + + /** + * @param maxSpeed the maxSpeed to set + */ + public void setMaxSpeed(int maxSpeed) { + this.maxSpeed = maxSpeed; + } + + /** + * @return the color + */ + public String getColor() { + return color; + } + + /** + * @param color the color to set + */ + public void setColor(String color) { + this.color = color; + } + public String makeNoise() { + return "Vroom Vroom"; + } + +}