-
Notifications
You must be signed in to change notification settings - Fork 0
/
SwitchCase-1.enc
54 lines (43 loc) · 1.68 KB
/
SwitchCase-1.enc
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
51
52
53
54
import java.util.*;
class SwitchCase{
public static void main(String args[]){
double n,d,a=0;
String c;
Scanner sc = new Scanner(System.in);
System.out.println("enter L for laptop and D for desktop");
c=sc.next();
System.out.println("enter amount:");
n=sc.nextDouble();
switch(c){
case "L":
if (n<=100000){
d=(n*0.075);
a=n-d;
System.out.println("net amount pay:Rs"+a);
break;
}
if (n>100000){
d=(n*0.1);
a=n-d;
System.out.println("net amount pay:Rs"+a);
break;
}
case "D":
if (n<=100000){
d=(n*0.1);
a=n-d;
System.out.println("net amount pay:Rs"+a);
break;
}
if (n>100000){
d=(n*0.15);
a=n-d;
System.out.println("net amount pay:Rs"+a);
break;
}
default:
System.out.println("thats an invalid option you have selected");
break;
}
}
}