-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnack_IM.java
More file actions
42 lines (38 loc) · 764 Bytes
/
Snack_IM.java
File metadata and controls
42 lines (38 loc) · 764 Bytes
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
/**
* This class is an abstraction for a snack.
* The snack has its name and cost as instances.
*
* @IMukhametzhanova
* @1.8
* 11/8/18
*/
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Snack_IM
{
private String name;
private double cost;
/**
* Constructor that takes in the name and cost of one unit
*/
public Snack_IM(String name, double cost)
{
this.name = name;
this.cost = cost;
}
/**
* Get the snack's name
*/
public String getName()
{
return name;
}
/**
* Get the snack's cost (for one unit)
*/
public double getCost()
{
return cost;
}
}