Advertisement
Ham62

Comp 1010 iClicker Questions

Oct 9th, 2018
969
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. Question 1:
  2. How many statements (as defined in class) are there in the code below?
  3. Warning: is a tricky one. The code is valid
  4. { println("Step 2");
  5. { println("Step 2a");
  6. { println("Step 2a.1");
  7. { }
  8. }
  9. }
  10. }
  11.  
  12. A. 1
  13. B. 3
  14. C. 4
  15. D. 7
  16. E. None of the above
  17.  
  18. ---------------------
  19.  
  20. Question 2:
  21. What value do you expect x to have after
  22. executing the code below?
  23. float x = (16.0+8.0/2)*(1/2);
  24. A. 0.0
  25. B. 6.0
  26. C. 10.0
  27. D. 12.0
  28. E. 20.0
  29.  
  30. ---------------------
  31.  
  32. Question 3:
  33. What value do you expect x to have after
  34. executing the code below?
  35. int x = (1/2)*(3+2+5f);
  36. A. 0
  37. B. 5
  38. C. 10
  39. D. Nothing - there is an error
  40.  
  41. ---------------------
  42.  
  43. Question 4:
  44. What type is the result of the expression below?
  45. 123456789L + 1.0
  46.  
  47. A. int
  48. B. long
  49. C. float
  50. D. double
  51.  
  52. ---------------------
  53.  
  54. Question 5:
  55. What value do you expect y to have after
  56. executing the code below?
  57. float x = 0.2/0.3;
  58. float y = x*45.0;
  59.  
  60. A. 30 exactly
  61. B. 30.0 exactly
  62. C. 30.0 approximately
  63. D. Nothing - there is an error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement