Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <script language='JavaScript'>
- function date(num){
- switch(num){
- case 0:
- document.write('Sunday!' + '<p>');
- break;
- case 1:
- document.write('Monday!' + '<p>');
- break;
- case 2:
- document.write('Tuesday!' + '<p>');
- break;
- case 3:
- document.write('Wednesday!' + '<p>');
- break;
- case 4:
- document.write('Thursday!' + '<p>')
- break;
- case 5:
- document.write('Friday!' + '<p>')
- break;
- default:
- document.write('Input Error!' + '<p>')
- break;
- }
- }
- date(0);
- date(1);
- date(2);
- date(3);
- date(4);
- date(5);
- </script>
- <h1>=============================</h1>
- <script language='JavaScript'>
- function price(fruit){
- switch (fruit){
- case 'Orange':
- Cost = 5*qty;
- document.write('Fruit ' + '$5!' + '<p>');
- document.write(aty
- break;
- case 'Orange':
- Cost = 1.5*qty;
- document.write('Fruit ' + '$1.5!' + '<p>');
- break;
- case 'Lemon':
- Cost = 10*qty;
- document.write('Fruit ' + '$10!' + '<p>');
- break;
- case 'Grape':
- Cost = 2*qty;
- document.write('Fruit ' + '$2!' + '<p>');
- break;
- case 'Banana':
- Cost = 3*qty;
- document.write('Fruit ' + '$3!' + '<p>');
- break;
- case 'Apple':
- Cost = 5*qty;
- document.write('Fruit ' + '$5!' + '<p>');
- break;
- default:
- document.write('Input Error!' + '<p>')
- break;
- }
- }
- price('Orange',6);
- price('Lemon',6);
- price('Grape',6);
- price('Banana',6);
- price('Apple',6);
- price('Input Error',6);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement