Advertisement
Vendrick-Xander

HW #6

Nov 29th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. 28. int a = 3;
  2. int b = 5;
  3. double x = (a + b) / 2;
  4. System.out.print(x);
  5. 30. int a = 7;
  6. int a = a++;
  7. 31. int a = 7;
  8. int a *= 3;
  9.  
  10. 36. It would throw an error saying that the value of that number is too large because zero goes into five an infinite number of times, so it would max out the allocated space.
  11. 37. There is a space between the minus and the equals so it is not registered as a shortcut
  12.  
  13. 42. Because you used only integers in the original division, the out put when that number is transferred is .0 but if you added a .0 to the end of the one of the integers you used while doing the division the answer would be what you expected
  14. 43. the '+' sign was put after the equals so the code didn't recognize it as a shortcut. If you swapped the plus to go in front of the = it would work
  15.  
  16. 45. int a = 1;
  17. int b = 7;
  18. int c = 9;
  19. int d = 34;
  20. System.out.print((a + b + c + d)/2);
  21.  
  22. 51. You would need to import some libraries that allow you to make certain characters become superscript. IDK which libraries are able to do that but stack overflow provided some examples of how it might work. If you are doing things with HTML then you might be able to type <sup> to apply that change to certain characters following it and then </sup> to stop it being applied.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement