-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReport.java
More file actions
28 lines (23 loc) · 766 Bytes
/
Report.java
File metadata and controls
28 lines (23 loc) · 766 Bytes
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
package cafeteria;
class Report {
private double totalSales;
private String reportID;
private String generatedBy;
public Report(String generatedBy) {
this.totalSales = 0;
this.reportID = "REP" + System.currentTimeMillis(); // Generate unique report ID
this.generatedBy = generatedBy;
}
public void addSales(double amount) {
totalSales += amount;
}
public void generateReport() {
System.out.println("Total Sales Report: " + totalSales);
System.out.println("Report ID: " + reportID);
System.out.println("Generated By: " + generatedBy);
System.out.println("Total Sales: ETB " + totalSales);
}
public double getTotalSales() {
return totalSales;
}
}