Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/VehicleNoises.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public static void main(String[] args) {

Unicycle myUnicycle = new Unicycle("Red",false,25);
System.out.println(myUnicycle.makeNoise());


RC_Car rcCar = new RC_Car();
System.out.println(rcCar.makeNoise());
}

}
38 changes: 38 additions & 0 deletions src/model/RC_Car.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package model;
//new vehicle
public class RC_Car{
private int age;
private String model;
private String sound = "nyoooooooooom... battery low";

public RC_Car(int age, String model, String sound) {
super();
this.age = age;
this.model = model;
this.sound = sound;
}
public RC_Car() {}

public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getSound() {
return sound;
}
public void setSound(String sound) {
this.sound = sound;
}

public String makeNoise() {
return this.sound;
}
}