Advertisement
LeoChan

Untitled

Apr 25th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. <html>
  2. <body>
  3. <script language='JavaScript'>
  4. function date(num){
  5. switch(num){
  6. case 0:
  7. document.write('Sunday!' + '<p>');
  8. break;
  9. case 1:
  10. document.write('Monday!' + '<p>');
  11. break;
  12. case 2:
  13. document.write('Tuesday!' + '<p>');
  14. break;
  15. case 3:
  16. document.write('Wednesday!' + '<p>');
  17. break;
  18. case 4:
  19. document.write('Thursday!' + '<p>')
  20. break;
  21. case 5:
  22. document.write('Friday!' + '<p>')
  23. break;
  24. default:
  25. document.write('Input Error!' + '<p>')
  26. break;
  27. }
  28. }
  29. date(0);
  30. date(1);
  31. date(2);
  32. date(3);
  33. date(4);
  34. date(5);
  35. </script>
  36. <h1>=============================</h1>
  37. <script language='JavaScript'>
  38. function price(fruit){
  39. switch (fruit){
  40. case 'Orange':
  41. Cost = 5*qty;
  42. document.write('Fruit ' + '$5!' + '<p>');
  43. document.write(aty
  44. break;
  45. case 'Orange':
  46. Cost = 1.5*qty;
  47. document.write('Fruit ' + '$1.5!' + '<p>');
  48. break;
  49. case 'Lemon':
  50. Cost = 10*qty;
  51. document.write('Fruit ' + '$10!' + '<p>');
  52. break;
  53. case 'Grape':
  54. Cost = 2*qty;
  55. document.write('Fruit ' + '$2!' + '<p>');
  56. break;
  57. case 'Banana':
  58. Cost = 3*qty;
  59. document.write('Fruit ' + '$3!' + '<p>');
  60. break;
  61. case 'Apple':
  62. Cost = 5*qty;
  63. document.write('Fruit ' + '$5!' + '<p>');
  64. break;
  65. default:
  66. document.write('Input Error!' + '<p>')
  67. break;
  68. }
  69. }
  70.  
  71.  
  72. price('Orange',6);
  73. price('Lemon',6);
  74. price('Grape',6);
  75. price('Banana',6);
  76. price('Apple',6);
  77. price('Input Error',6);
  78. </script>
  79.  
  80. </body>
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement