-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoLauncher.java
More file actions
50 lines (46 loc) · 1.36 KB
/
VideoLauncher.java
File metadata and controls
50 lines (46 loc) · 1.36 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
package MP1;
import java.util.*;
public class VideoLauncher {
public static void main(String[] args) {
// TODO Auto-generated method stub
int opt = 0;
Scanner sc = new Scanner(System.in);
VideoStore vs = new VideoStore();
while(opt != 6)
{
System.out.print("Main Menu\n======\n1.Add Video\n2.Check Out Video\n3.Return Video\n4.Receive Rating\n5.List Inventory\n6.Exit\nEnter your choice : ");
opt = sc.nextInt();
sc.nextLine();
switch(opt)
{
case 1:
System.out.print("Enter the name of the video you want to add : ");
String name = sc.nextLine();
vs.addVideo(name);
break;
case 2:
System.out.print("Enter the name of the video you want to checkout : ");
String name1 = sc.nextLine();
vs.doCheckout(name1);
break;
case 3:
System.out.print("Enter the name of the video you want to return : ");
String name2 = sc.nextLine();
vs.doReturn(name2);
break;
case 4:
System.out.print("Enter the name f the video you want to rate : ");
String name3 = sc.nextLine();
System.out.print("Enter the rating of this video : ");
int rating = sc.nextInt();
vs.receiveRating(name3, rating);
break;
case 5:
vs.listInventory();
break;
}
}
System.out.println("Exitig!!! Thank you for using this application.");
sc.close();
}
}