-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvoice.java
More file actions
50 lines (44 loc) · 1.19 KB
/
Invoice.java
File metadata and controls
50 lines (44 loc) · 1.19 KB
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
/**
* Represents an Invoice
*
* @author Andon Shkurti
* @version 3/11/15
*/
public class Invoice {
int number, quantity; // represents an invoice number
static double runningTotal; // represents the amount of running total
static String invoice;// used to keep the information of the products
static public String product;
static public double price;
/**
* Will create the invoice
*/
public Invoice () {
}
/**
* Adds the products created to an invoice
*
* @param the Invoice of the customer
*/
public static void addToInvoice(String product, double price) {
product = product;
price = price;
}
/**
* Returns the total price for the product
*
* @return the total price
*/
public static double getTotal() {
return runningTotal;
}
/**
* Returns a printable representation of the invoice
*
* @return a printable representation of the invoice
*/
public String toString() {
return "Product: " + product + " Price: $" + price + " Quantity: " + quantity +
" Total Price: " + runningTotal;
}
}