-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAmountTypeCasting.java
More file actions
35 lines (27 loc) · 1.18 KB
/
AmountTypeCasting.java
File metadata and controls
35 lines (27 loc) · 1.18 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
import billmanagment.BillDetails;
import java.util.Scanner;
public class AmountTypeCasting {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the billId: ");
int billId = sc.nextInt();
System.out.print("Enter the customer Id: ");
int customerId = sc.nextInt();
System.out.print("Enter the discount: ");
int discount = sc.nextInt();
System.out.print("Enter the Bill amount: ");
double billAmount = sc.nextDouble();
BillDetails obj = new BillDetails();
obj.setBillId(billId);
obj.setCustomerId(customerId);
obj.setDiscount(discount);
obj.setBillAmount(billAmount);
obj.clearScreen();
System.out.println("\nBill Id: "+obj.getBillId());
System.out.println("\nCustomer Id: "+obj.getCustomerId());
System.out.println("\nDiscount: "+obj.getDiscount());
System.out.println("\nBill amount: "+obj.getBillAmount());
System.out.println("\nBill amount after Discount: "+obj.getDiscountedBillAmount());
sc.close();
}
}