-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestInvoice.java
45 lines (38 loc) · 1.26 KB
/
TestInvoice.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
import java.util.Scanner;
public class TestInvoice
{
public static void main (String [] args)
{
Invoice myInvoice;
myInvoice = getInvoiceData();
displayInvoice(myInvoice);
}
public static Invoice getInvoiceData()
{
Invoice tempIn = new Invoice();
String iName;
int id;
int Qt;
int Pr;
double TC;
Scanner input = new Scanner (System.in);
System.out.print("Enter Item Name >> " );
iName = input.nextLine();
tempIn.setiName(iName);
System.out.print("Enter Item # >> ");
id = input.nextInt();
tempIn.setiNumber(id);
System.out.print("Enter Item Quantity >> " );
Qt = input.nextInt();
tempIn.setQuantity(Qt);
System.out.print("Enter Item Price >> " );
Pr = input.nextInt();
tempIn.setPrice(Pr);
return tempIn;
}
public static void displayInvoice(Invoice anEmp)
{
System.out.println("\nItem Name is: "+anEmp.getiName()+ "\nItem # is: " +anEmp.getiNumber()+"\nQuantity Name is: " +anEmp.getQuantity()+
"\nItem Price is: "+anEmp.getPrice()+ "\nThe Total Cost is: " +anEmp.gettCost());
}
}