-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIncome.java
59 lines (51 loc) · 987 Bytes
/
Income.java
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
package Daily1;
public class Income extends Data{
private IncomeCategory income_category;
public Income(){
super();
income_category = IncomeCategory.ANONYMOUS;
}
public Income(String description){
super(description);
int j=1;
int s=8;
for(ExpenseCategory i:ExpenseCategory.values())
{
System.out.println(j+" "+i);
j=j+1;
}
while(s>7)
{
System.out.println("Enter a number between 1 and 4");
s=sc.nextInt();
}
switch(s)
{
case 1:
income_category = IncomeCategory.CASH;
break;
case 2:
income_category = IncomeCategory.CARD;
break;
case 3:
income_category = IncomeCategory.SAVINGS;
break;
case 4:
income_category = IncomeCategory.SALARY;
break;
case 5:
income_category = IncomeCategory.PROFIT;
break;
case 6:
income_category = IncomeCategory.GIFT;
break;
case 7:
income_category = IncomeCategory.ANONYMOUS;
break;
default:
}
}
}
enum IncomeCategory {
CASH,CARD,SAVINGS,SALARY,PROFIT,GIFT,ANONYMOUS
}