-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExpenseInputScreen.java
40 lines (33 loc) · 1.03 KB
/
ExpenseInputScreen.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
import java.util.Scanner;
import java.util.*;
import java.io.*;
public class ExpenseInputScreen
{
private int month;
private int day;
private String category;
private String payee;
private float amount;
protected static ExpenseRecord list = new ExpenseRecord();
public void inputScreen()
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter month (1-12): ");
month = scan.nextInt();
System.out.println("Enter day (1-31): ");
day = scan.nextInt();
scan.nextLine();
System.out.println("Enter expense category (Repairs, Utilities, or Insurance): ");
category = scan.nextLine();
System.out.println("Enter payee (Bob's Hardware, Big ELectric Co, etc.): ");
payee = scan.nextLine();
System.out.println("Enter amount (39.95): ");
amount = scan.nextFloat();
Expense expense = new Expense(month,day,payee,amount,category);
list.addExpense(expense);
}
public void displayExpenseRecord() throws FileNotFoundException
{
list.displayExpenseRecord();
}
}