Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. 38.
  2. true
  3.  
  4. 39.
  5. false
  6.  
  7. 40.
  8. true
  9.  
  10. 41.
  11. error
  12.  
  13. 42.
  14. true
  15.  
  16. 43.
  17. 20
  18.  
  19. 44.
  20. 15
  21.  
  22. 45.
  23. 2 4 3 6 5 4
  24.  
  25. 46.
  26. 12345
  27.  
  28. 47.
  29. --
  30. -XXX-
  31. -XXXXXX-
  32.  
  33. 48a.
  34. 0
  35.  
  36. 48b.
  37. 1
  38.  
  39. 49b.
  40. 15
  41.  
  42. page290
  43. -------
  44. 2a. T
  45. 2b. F
  46. 2c. T
  47. 2d. F
  48. 2e. T
  49. 2f. F
  50. 2g. F
  51. 2h. T
  52. 2i. T
  53.  
  54. 3a.
  55. 13 21
  56.  
  57. 3b.
  58. 5 6
  59.  
  60. 3c.
  61. 6 6
  62.  
  63. 3d.
  64. 7 11
  65.  
  66. 9. The following code is poorly structured...rewrite it so it has a better structure and avoids redundancy...
  67.  
  68. Scanner console = new Scanner(system.in);
  69. System.out.print("How much will John be spending? ");
  70. int numBills1 = (int) Math.ceil(console.nextDouble());
  71. System.out.println("How much will Jane be spending? ");
  72. int numBills2 = (int) Math.ceil(console.nextDouble());
  73. System.out.println("John needs " + amount + " bills");
  74. System.out.println("Jane needs " + amount + " bills");
  75.  
  76. BOOLEAN EXPRESSIONS 2
  77.  
  78. 26. F
  79. 27. F
  80. 28. F
  81. 29. F
  82. 30. F
  83. 31. F
  84. 32. ERROR
  85. 33. F (i think, problem got cut off)
  86. 34. not sure, got cut off
  87. 35. F (i think, may be cut off?)
  88.  
  89. 38. Assuming the following code represents...
  90. If the file is not found, there is nothing printed. Add a catch block which prints to the user that there is an error.
  91.  
  92. 37. The following method suffers from... (not sure what the fencepost problem is, but here's my guess)...
  93.  
  94. static void fencePost(int start, int end){
  95. int sum = 0; //though this is never used in the program
  96.  
  97. for(int i = start; i < end-1; i++){
  98. System.out.print(i);
  99. System.out.print(",");
  100. }
  101. System.out.println(end-1);
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement