fork download
  1. /* Abreu, Dianne
  2.  * Apo, Andrea
  3.  * Gardose, Zanetha
  4.  * Manuel, Jezariel
  5.  * Ouano, Genisha
  6.  * Padan, Rheiva
  7.  * Sepian, Rogelyn
  8.  * Tupaen, Vivien
  9.  * Faypon, Jeremy
  10.  */
  11. import java.util.Scanner;
  12. import javax.swing.*;
  13. class
  14.  
  15. {
  16. public static void main(String args[])
  17. {
  18. Scanner x=new Scanner(System.in);
  19. Scanner input=new Scanner(System.in);
  20. JOptionPane.showMessageDialog(null,"Welcome!\n");
  21. int doItAgain = 1;
  22. while(doItAgain ==1){
  23. try{
  24. int a,b,c,d=0,e,i,j,k,l,m,n;
  25. String f,g,h;
  26. String Convert;
  27. a = Integer.parseInt(JOptionPane.showInputDialog("Choices: \n\t\t[1]-Daily Newspaper\n\t\t[2]-Weekly Newspaper\nChoose the kind of newspaper you want to reserve?: " ));
  28. while(a>2||a<1)
  29. {
  30. a = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice!\n Please choose from the following only. \n 1-Daily Newspaper, 2-Weekly Newspaper \nChoose the kind of newspaper you want to reserve?: "));
  31. }
  32. if(a==1)
  33. {
  34.  
  35. b = Integer.parseInt(JOptionPane.showInputDialog("-----------DAILY NEWSPAPER-----------\n\n\t\tChoices: \n\t\t[1]-Manila Bulletin\n\t\t[2]-Daily Inquirer\n\t\t[3]-Philippine Star\n\t\tChoose the type of newspaper you want to reserve?: "));
  36. while(b>3||b<1)
  37. {
  38. b = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice! \n Please choose from the following only.\n\t\t[1]-Manila Bulletin\n\t\t[2]-Daily Inquirer\n\t\t[3]-Philippine Star\n\t\tChoose the type of newspaper you want to reserve?: "));
  39. }
  40. switch(b)
  41. {
  42.  
  43. case 1:
  44. {
  45. c = Integer.parseInt(JOptionPane.showInputDialog("-----------MANILA BULLETIN-----------\nChoose from the following days:\n\t\t\t[1]-Monday\n\t\t\t[2]-Tuesday\n\t\t\t[3]-Wednesday\n\t\t\t[4]-Thursday\n\t\t\t[5]-Friday\n\t\t\t[6]-Saturday\n\t\t\t[7]-Sunday\nChoose the day of the newspaper you want to reserve?: "));
  46. while(c>7||c<1)
  47. {
  48. c = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice!\nPlease choose from the following only.\n\t\t\t[1]-Monday\n\t\t\t[2]-Tuesday\n\t\t\t[3]-Wednesday\n\t\t\t[4]-Thursday\n\t\t\t[5]-Friday\n\t\t\t[6]-Saturday\n\t\t\t[7]-Sunday\nChoose the day of the newspaper you want to reserve?: "));
  49. }
  50. if(d==0)
  51. {
  52. e = Integer.parseInt(JOptionPane.showInputDialog("Choices:\n\t\t\t[1]-Yes\n\t\t\t[2]-No\nDo you really want to reserve the newspaper?: "));
  53. if(e==1)
  54. {
  55. d=d+1;
  56. JOptionPane.showMessageDialog(null,"Kindly fill-up the needed information:");
  57. f = JOptionPane.showInputDialog("Name: ");
  58. g = JOptionPane.showInputDialog("Year: ");
  59. h = JOptionPane.showInputDialog("Section: ");
  60. JOptionPane.showMessageDialog(null,"Thank You,"+f+" of "+h+" from school year "+"["+g+"]"+" You have succesfully reserved the newspaper,");
  61. }
  62. }
  63.  
  64. break;
  65. }
  66.  
  67. case 2:
  68. {
  69. c = Integer.parseInt(JOptionPane.showInputDialog("-----------DAILY INQUIRER----------- \nChoose from the following days:\n\t\t\t[1]-Monday\n\t\t\t[2]-Tuesday\n\t\t\t[3]-Wednesday\n\t\t\t[4]-Thursday\n\t\t\t[5]-Friday\n\t\t\t[6]-Saturday\n\t\t\t[7]-Sunday\nChoose the day of the newspaper you want to reserve?: "));
  70. while(c>7||c<1)
  71. {
  72. c = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice!\nPlease choose from the following only\n\t\t\t[1]-Monday\n\t\t\t[2]-Tuesday\n\t\t\t[3]-Wednesday\n\t\t\t[4]-Thursday\n\t\t\t[5]-Friday\n\t\t\t[6]-Saturday\n\t\t\t[7]-Sunday.\nChoose the day of the newspaper you want to reserve?: "));
  73. }
  74. if(d==0)
  75. {
  76. e = Integer.parseInt(JOptionPane.showInputDialog("Choices:\n\t\t\t[1]-Yes\n\t\t\t[2]-No\nDo you really want to reserve the newspaper?: "));
  77. if(e==1)
  78. {
  79. d=d+1;
  80. JOptionPane.showMessageDialog(null,"Kindly fill-up the needed information:");
  81. f = JOptionPane.showInputDialog("Name: ");
  82. g = JOptionPane.showInputDialog("Year: ");
  83. h = JOptionPane.showInputDialog("Section: ");
  84. JOptionPane.showMessageDialog(null,"Thank You,"+f+" of "+h+" from school year "+"["+g+"]"+" You have succesfully reserved the newspaper,");
  85. }
  86. }
  87. break;
  88. }
  89.  
  90. case 3:
  91. {
  92. c = Integer.parseInt(JOptionPane.showInputDialog("-----------PHILIPPINE STAR-----------\nChoose from the following days:\n\t\t\t[1]-Monday\n\t\t\t[2]-Tuesday\n\t\t\t[3]-Wednesday\n\t\t\t[4]-Thursday\n\t\t\t[5]-Friday\n\t\t\t[6]-Saturday\n\t\t\t[7]-Sunday \nChoose the day of the newspaper you want to reserve?: "));
  93. while(c>7||c<1)
  94. {
  95. c = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice!\nPlease choose from the following only\n\n\t\t\t[1]-Monday\n\t\t\t[2]-Tuesday\n\t\t\t[3]-Wednesday\n\t\t\t[4]-Thursday\n\t\t\t[5]-Friday\n\t\t\t[6]-Saturday\n\t\t\t[7]-Sunday\nChoose the day of the newspaper you want to reserve?: "));
  96. }
  97. if(d==0)
  98. {
  99. e = Integer.parseInt(JOptionPane.showInputDialog("Choices:\n\t\t\t[1]-Yes\n\t\t\t[2]-No\nDo you really want to reserve the newspaper?: "));
  100. if(e==1)
  101. {
  102. d=d+1;
  103. JOptionPane.showMessageDialog(null,"Kindly fill-up the needed information:");
  104. f = JOptionPane.showInputDialog("Name: ");
  105. g = JOptionPane.showInputDialog("Year: ");
  106. h = JOptionPane.showInputDialog("Section: ");
  107. JOptionPane.showMessageDialog(null,"Thank You,"+f+" of "+h+" from school year "+"["+g+"]"+" You have succesfully reserved the newspaper,");
  108. }
  109. }
  110. break;
  111. }
  112. }//switch
  113. }//if
  114. if(a==2)
  115. {
  116. b = Integer.parseInt(JOptionPane.showInputDialog("-----------WEEKLY NEWSPAPER----------- \nChoices: \n\t\t\t[1]-Cordillera Today\n\t\t\t[2]-Midland Courier\nChoose the type of newspaper you want to reserve?: "));
  117. while(b>2||b<1)
  118. {
  119. b = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice! \n Please choose from the following only. \n\t\t\t[1]-Cordillera Today\n\t\t\t[2]-Midland Courier\nChoose the type of newspaper you want to reserve?: "));
  120. }
  121.  
  122. switch(a)
  123. {
  124. case 1:
  125. {
  126. c = Integer.parseInt(JOptionPane.showInputDialog("-----------CORDILLERA TODAY----------- \nChoose from the following weeks: \n\t\t\t[1]-Week 1\n\t\t\t[2]-Week 2\n\t\t\t[3]-Week 3\n\t\t\t[4]-Week 4\nChoose the week of the newspaper you want to reserve?: "));
  127.  
  128. while(c>4||c<1)
  129. {
  130. c = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice!\nPlease choose from the following only.\n\t\t\t[1]-Week 1\n\t\t\t[2]-Week 2\n\t\t\t[3]-Week 3\n\t\t\t[4]-Week 4\nChoose the week of the newspaper you want to reserve?: "));
  131. }
  132. if(d==0)
  133. {
  134. e = Integer.parseInt(JOptionPane.showInputDialog("Choices:\n\t\t\t[1]-Yes\n\t\t\t[2]-No\nDo you really want to reserve the newspaper?: "));
  135. if(e==1)
  136. {
  137. d=d+1;
  138. JOptionPane.showMessageDialog(null,"Kindly fill-up the needed information:");
  139. f = JOptionPane.showInputDialog("Name: ");
  140. g = JOptionPane.showInputDialog("Year: ");
  141. h = JOptionPane.showInputDialog("Section: ");
  142. JOptionPane.showMessageDialog(null,"Thank You,"+f+" of "+h+" from school year "+"["+g+"]"+" You have succesfully reserved the newspaper,");
  143. }
  144. }
  145. }
  146. case 2:
  147. {
  148. c = Integer.parseInt(JOptionPane.showInputDialog("-----------MIDLAND COURIER-----------\nChoose from the following weeks: \n\t\t\t[1]-Week 1\n\t\t\t[2]-Week 2\n\t\t\t[3]-Week 3\n\t\t\t[4]-Week 4\nChoose the week of the newspaper you want to reserve?: "));
  149.  
  150. while(c>4||c<1)
  151. {
  152. c = Integer.parseInt(JOptionPane.showInputDialog("Invalid choice!\nPlease choose from the following only.\n 1-Week 1, 2-Week 2, 3-Week 3, 4-Week 4 \nChoose the week of the newspaper you want to reserve?: "));
  153. }
  154. if(d==0)
  155. {
  156. e = Integer.parseInt(JOptionPane.showInputDialog("Choices:\n\t\t\t[1]-Yes\n\t\t\t[2]-No\nDo you really want to reserve the newspaper?: "));
  157. if(e==1)
  158. {
  159. d=d+1;
  160. JOptionPane.showMessageDialog(null,"Kindly fill-up the needed information:");
  161. f = JOptionPane.showInputDialog("Name: ");
  162. g = JOptionPane.showInputDialog("Year: ");
  163. h = JOptionPane.showInputDialog("Section: ");
  164. JOptionPane.showMessageDialog(null,"Thank You,"+f+" of "+h+" from school year "+"["+g+"]"+" You have succesfully reserved the newspaper,");
  165. }
  166. }
  167. }
  168. }//switch
  169. }//if
  170. doItAgain = Integer.parseInt(JOptionPane.showInputDialog("Want TO Try Again? : \n Input 1 to try again \n Input 0 to terminate the Program"));
  171. while(doItAgain!=1&&doItAgain!=0)
  172. {
  173. doItAgain = Integer.parseInt(JOptionPane.showInputDialog("Error!? : \n Input 1 to try again \n Input 0 to terminate the Program"));
  174. }
  175. }catch(Exception error){
  176. System.exit(0);
  177. }
  178. }//loop
  179.  
  180. }
  181. }
  182.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:13: <identifier> expected
class 
     ^
1 error
stdout
Standard output is empty