-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFood.java
More file actions
executable file
·71 lines (60 loc) · 1.43 KB
/
Food.java
File metadata and controls
executable file
·71 lines (60 loc) · 1.43 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
import java.util.ArrayList;
/**
* This is the food class.
* This is where the list of food is created. The food will help the players drunk meter by making
* them more sober, however will cost the players money.
*
*These items functions are a String which provides the food name and an int to produce the cost.
* @author
* @version
*/
public class Food
{
// instance variables - replace the example below with your own
private ArrayList <String> food;
private String fName;
public int fPrice;
/**
* Constructor for objects of class Food
*/
public Food(String foodName, int foodPrice)
{
fName = foodName;
fPrice = foodPrice;
}
/**
* An example of a method - replace this comment with your own
*
* @return String food name
*/
public String getfName()
{
return fName;
}
/**
* return int food price
*/
public int getfPrice()
{
return fPrice;
}
/**
* @param This makes new foods and below it makes new prices.
*/
public void setfName(String newFood)
{
fName = newFood;
}
public void setfPrice(int foodPrice)
{
fPrice = foodPrice;
}
/**
* @param this prints the results of the food name and prices
*/
public void printFood()
{
System.out.println(fName);
System.out.println(fPrice);
}
}