-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrink.java
More file actions
executable file
·69 lines (59 loc) · 1.44 KB
/
Drink.java
File metadata and controls
executable file
·69 lines (59 loc) · 1.44 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
/**
* This is the drink class
* This is where the list of Drinks for the game are created. These drinks will mainly be
* alcohol to hinder the players drunk Meter. These items will also cost the players money.
*
* I have used int values for the prices and a String for the name of the drinks.
*
* @author
* @version
*/
//going to need to seperate object water and alcohol so that it comes up wih two different responses.
public class Drink
{
// instance variables - replace the example below with your own
private String Drink;
public int dPrice;
/**
* Constructor for objects of class Drink
*/
public Drink(String drinkName, int drinkPrice)
{
Drink = drinkName;
dPrice = drinkPrice;
}
/**
* An example of a method - replace this comment with your own
* @return Drink name
*/
public String getDrink()
{
return Drink;
}
/**
* @return drink price
*/
public int getdPrice()
{
return dPrice;
}
/**
* param this create a new drink.
*/
public void setDrink(String newDrink)
{
Drink = newDrink;
}
public void setdPrice(int drinkPrice)
{
dPrice = drinkPrice;
}
/**
* @param this prints out the information from the Drink class
*/
public void printDrink()
{
System.out.print(Drink);
System.out.print(dPrice);
}
}