-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGolf_Club.java
More file actions
66 lines (64 loc) · 1.43 KB
/
Golf_Club.java
File metadata and controls
66 lines (64 loc) · 1.43 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package practicetime;
import java.util.Scanner;
public class Golf_Club
{
Scanner sc=new Scanner(System.in);
int i,g,r,m;
String s;
public void choice()
{
do
{
System.out.println(" 1. Add Golf Club \n 2. Remove \n 3. View Current \n 4. Checkout ");
System.out.println(" Enter Your Choice ");
i=sc.nextInt();
switch(i)
{
case 1:
{
System.out.println(" You Have Zero. How many to Add? - ");
g=sc.nextInt();
System.out.println(" You Now Have "+g);
break;
}
case 2:
{
System.out.println(" You Now Have "+g+" How Many To Remove? - ");
r=sc.nextInt();
g=g-r;
System.out.println(" You Now Have "+g);
break;
}
case 3:
{
System.out.println(" You Now Have "+g);
System.out.println(" Cost Rs 4000 ");
System.out.println(" Total Cost - "+(g*4000));
break;
}
case 4:
{
System.out.println(" What is Your Name ?");
s=sc.next();
System.out.println(" You Have Purchased "+g);
System.out.println(" Golf Cost 4000 each");
System.out.println(" Total Cost - "+(g*4000));
System.out.println(" Thanks for Your Order "+s);
break;
}
default:
{
System.out.println(" Wrong Choice ");
}
}
System.out.println(" Press 1 To Continue Else 2");
m=sc.nextInt();
}while(m==1);
System.out.println(" Done ! ");
}
public static void main(String args[])
{
Golf_Club c=new Golf_Club();
c.choice();
}
}