-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathDiscount.java
More file actions
17 lines (15 loc) · 646 Bytes
/
Discount.java
File metadata and controls
17 lines (15 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.dsa;
import java.util.Scanner;
public class Discount {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("Enter the original price of product");
int original_price=input.nextInt();
System.out.println("Enter the discount percentage");
float discount=input.nextInt();
float discount_price=original_price*(discount/100);
float final_price=original_price-discount_price;
System.out.println("The discount price is: "+discount_price);
System.out.println("The final price after discount is: "+final_price);
}
}