import java.util.*;
public class DVD_Rental_Program {
static Scanner kb= new Scanner(System.in);
public static void main(String[] args) {
int a,b,c,d,e, day, movLen;
double total, movCharge;
String movTitle, movDate;
boolean flag = true;
while (flag) {
mainMessage();
a = kb.nextInt();
switch (a) {
case 1:
genre();
b = kb.nextInt();
switch (b){ // for the HORROR
case 1:
horror();
c = kb.nextInt();
switch (c) //inside horror
{
case 1://horror 1
System.out.println("****************************** ***********");
movTitle = "Drag Me To Hell";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 90;
movCharge = 4.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "August 2009";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $4.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
}
break;
case 2: //inside horror 2
System.out.println("****************************** ***********");
movTitle = "Paranormal Activity";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 105;
movCharge = 5.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "October 2009";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $5.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
}
break;
case 3: //inside horror 3
System.out.println("****************************** ***********");
movTitle = "Shutter";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 95;
movCharge = 3.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "June 2008";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $3.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
}// end of horror
break;
case 2://for love
love();
d = kb.nextInt();
switch (d)//inside love
{
case 1:
System.out.println("****************************** ***********");
movTitle = "P.S I Love You";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 120;
movCharge = 4.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "Feburary 2009";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $4.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
case 2:
System.out.println("****************************** ***********");
movTitle = "500 Days Of Summer";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 105;
movCharge = 5.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "September 2009";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $5.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
case 3:
System.out.println("****************************** ***********");
movTitle = "The Notebook";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 95;
movCharge = 3.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "April 2005";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $3.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
}
break;
case 3:
thriller();
e = kb.nextInt();
switch (e)
{
case 1:
System.out.println("****************************** ***********");
movTitle = "2012";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 150;
movCharge = 5.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "November 2009";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $5.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
case 2:
System.out.println("****************************** ***********");
movTitle = "The Day After Tomorrow ";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 125;
movCharge = 4.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "March 2007";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $4.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
case 3:
System.out.println("****************************** ***********");
movTitle = "Gamer";
System.out.println("Desired Movie: "+movTitle);
System.out.println("-----------------------------------------");
System.out.println("Length Price Per Day");
movLen = 90;
movCharge =5.00;
System.out.println(movLen+" min S$"+ movCharge);
System.out.print
("Please select desired days to rent(1-9): ");
day = kb.nextInt();
if (1 <= day && day<=9)
{
System.out.println("Booking Information");
System.out.println("****************************** ***********");
System.out.println("Title: "+movTitle);
System.out.println("Length: "+movLen+" minutes");
movDate = "September 2009";
System.out.println("Movie Release Date: "+movDate);
System.out.println("Number of days rented:"+day);
System.out.println("Rental fee per day: $5.00");
total = day * movCharge;
System.out.println("Total:$"+total);
System.out.println("****************************** ***********");
System.out.println(" ");
System.out.println("(1) Confirm");
System.out.println("(2) Redo");
System.out.print("Please select your choice(1-2): ");
a = kb.nextInt();
}
if (a==1)
{
ok();
}
if (a==2)
{
defInOp();
b = kb.nextInt();
}
if(day>9)
{
defInOp();
b = kb.nextInt();
}
break;
default:
defInOp();
b = kb.nextInt();
}
case 4:
{
mainMessage();
}
}
break;
case 2:
System.out.println("You have rented the following DVD title(S):");
System.out.println("****************************** *************");
System.out.println(" ");
System.out.println("DVD Title: <"+movTitle +"> Rented for "+day +" day(s).");
total=
System.out.println("Payment of S$"+total +" is approved");
System.out.println("-------------------------------------------");
flag = false;
break;
default:
System.out.println("Sorry Please Key in the correct value.");
}
} // end of while
}
static void mainMessage()
{
System.out.println("Welcome to TP DVD Rental Service");
System.out.println(" ");
System.out.println("-------DVD Rental System-------");
System.out.println("--------------------------------");
System.out.println("(1) Rent A DVD");
System.out.println("(2) Exit");
System.out.println("--------------------------------");
System.out.println(" ");
System.out.print("Please select your choice(1-2): ");
}
static void genre()
{
System.out.println(" ");
System.out.println("**DVD Genre Selections**");
System.out.println("------------------------");
System.out.println("(1) Horror");
System.out.println("(2) Love Stories");
System.out.println("(3) Thrrillers");
System.out.println("------------------------");
System.out.print("Please select a category(1-3): ");
}
static void horror()
{
System.out.println(" ");
System.out.println("Horror Movie Selections");
System.out.println("-----------------------");
System.out.println("(1) Drag Me To Hell");
System.out.println("(2) Paranormal Activity");
System.out.println("(3) Shutter");
System.out.println("(4) Back to Main Menu");
System.out.println("-----------------------");
System.out.print("Please select desired movie(1-3): ");
}
static void love()
{
System.out.println(" ");
System.out.println("Love Stories Selections");
System.out.println("-----------------------");
System.out.println("(1) P.S I Love You");
System.out.println("(2) 500 Days Of Summer");
System.out.println("(3) The Notebook");
System.out.println("(4) Back to Main Menu");
System.out.println("------------------------");
System.out.print("Please select desired movie(1-3): ");
}
static void thriller()
{
System.out.println(" ");
System.out.println("Thriller Selection");
System.out.println("--------------------------------");
System.out.println("(1) 2012");
System.out.println("(2) The Day After Tomorrow");
System.out.println("(3) Gamer");
System.out.println("(4) Back to Main Menu");
System.out.println("--------------------------------");
System.out.print("Please select desired movie(1-3): ");
}
static void ok()
{
System.out.println("****************************** **********");
System.out.println("* Your dvd booking(s) is/are confirmed *");
System.out.println("****************************** **********");
}
static void defInOp()
{
System.out.println("Please re-select your booking.");
System.out.println(" ");
System.out.println("**DVD Genre Selections**");
System.out.println("------------------------");
System.out.println("(1) Horror");
System.out.println("(2) Love Stories");
System.out.println("(3) Thrrillers");
System.out.println("------------------------");
System.out.print("Please select a category(1-3): ");
}
}
1621928_10202382619462155_934817616_n.jpg1656124_10202382619622159_362448811_n.jpg