-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBonusExampl.java
More file actions
43 lines (31 loc) · 878 Bytes
/
Copy pathBonusExampl.java
File metadata and controls
43 lines (31 loc) · 878 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package practice;
import java.util.Scanner;
public class BonusExampl {
public static void main(String[] args) {
// bonus = salary*(5/100)
Scanner sc = new Scanner(System.in);
/*
System.out.println("Enter Experience :");
int vr = sc.nextInt();
if(vr>5) {
System.out.println("You will get bonus ");
System.out.println("Enter Salary :");
int sl = sc.nextInt();
double bonus = sl*5/100;
System.out.println("Your salary is :"+(sl+bonus));
}
else
System.out.println("You will not get bonus ");
*/
System.out.println("Enter the Purchased Amount : ");
int amt = sc.nextInt();
if(amt>=1000) {
System.out.println("You will get 10% Discount!");
double discount = amt*10/100;
System.out.println("Final Payment : "+(amt-discount));
}
else {
System.out.println("Thanks for shopping with us");
}
}
}