Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. function output(msg) {
  2. $('#output').append('<p>' + msg.toString() + '</p>');
  3. }
  4.  
  5. output('Your output below:');
  6. // Write your code below this line ...
  7.  
  8. output(prompt('What is your fav food'));
  9.  
  10. var ans = prompt('What is 2 + 2?');
  11.  
  12. switch (ans) {
  13. case '4':
  14. output('Good job');
  15. break;
  16. case '3' || '5':
  17. output('Almost');
  18. break;
  19. case '5':
  20. output('Almost');
  21. break;
  22. default:
  23. output('Math is hard')
  24. break;
  25. }
  26.  
  27. for (var i=100; i>=0; i--){
  28. if (i%3==0 && i%5==0){
  29. output('Lighthouse Labs');
  30. }
  31. else if (i%3==0){
  32. output('Lighthouse')
  33. }
  34. else if (i%5==0){
  35. output('Labs')
  36. }
  37. else{
  38. output(i);
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement