Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2.  
  3. Write the output of the following program on the lines provided as comments (7 pts):
  4.  
  5. public class Quiz {
  6. public static void main (String[] args) {
  7. // declare variables
  8. int k = 7, j = 3;
  9. double x = 2.5, y = -1.5;
  10. int m = 18 , n = 4;
  11.  
  12. System.out.println(k * j - m); //_____________
  13. System.out.println(j % k); //_____________
  14. System.out.println((double) (k/j)); //____________
  15. System.out.println(5.0 / 4 ); //_________
  16. System.out.println(5 * x - n / 5); // ____________
  17. System.out.println(m / n + m % n); //____________
  18. System.out.println(j / (int) x); //____________
  19. } // method main
  20. } // end of class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement