forked from Hevanly-Fire/Java-Encode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmycode
More file actions
23 lines (22 loc) · 661 Bytes
/
mycode
File metadata and controls
23 lines (22 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.*;
public class categories_expenses {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String arr [] = new String []{"Transportation", "Food", "Household", "Apparel", "Dairy"};
ArrayList<Double> amt = new ArrayList<Double>();
boolean flag=true;
System.out.println("Category");
int l = sc.nextInt();
String cat = arr[l];
System.out.println("Enter the amount");
while (flag)
{
in = sc.nextDouble();
if(in == -1)
flag = false;
else
amt.add(in);
}
}
}