-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDirtBike.java
More file actions
77 lines (51 loc) · 1.2 KB
/
DirtBike.java
File metadata and controls
77 lines (51 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* @author Valerie Underwood - vlunderwood
* CIS175 - Fall 2023
* Aug 28, 2023
*/
package model;
public class DirtBike {
// Instance variables describing the dirtbike
private String name;
private String color;
private Integer size;
// Parameterized constructor that accepts color, size, and name
public DirtBike(String name, Integer size, String color) {
this.name = name;
this.size = size;
this.color = color;
}
// Getter method for name
public String getName() {
return name;
}
// Setter method for name
public void setName(String name) {
this.name = name;
}
// Getter method for size
public Integer getSize() {
return size;
}
// Setter method for size
public void setSize(Integer size) {
this.size = size;
}
// Getter method for color
public String getColor() {
return color;
}
// Setter method for color
public void setColor(String color) {
this.color = color;
}
// overrides toString and returns dirtbikes description
@Override
public String toString() {
return "Vehicle [Rider Name=" + name + ", Engine size=" + size + ", color=" + color + "]";
}
// returns the dirtbike noise
public String makeNoise() {
return "Vroom! Vroom!";
}
}