Exposure Java Exercises

What spoken language is Java based on? 3. List 7 Java keywords. 4.
Programming languages require special ?containers? that their program
statements are put ...

Part of the document


|PreAPCS Exposure Java |Exercises 4.1- 3 |Date: |
|Name: KEY |Period: |



1. Which programming language requires a very precise organization?


2. What spoken language is Java based on?


3. List 7 Java keywords.


4. Programming languages require special "containers" that their program
statements are put in.
What are these containers called in Java?


5. If a program has syntax errors, can it compile?


6. If a program does not compile, will a byte code file be created?


7. What must all program statements end with?


8. Are "method headings" and "class heading" program statements?


9. Which keywords in Java are case-sensitive?


10. What kind of operator is the equal sign (=) ?


11. Why do computers exist?


12. Modules that perform a related set of functions are grouped together
in a special type of container.
What is this special container called?


13. What do classes contain?


14. What do methods contain?



15. What is the output of System.out.println(Math.sqrt(100)); ?


16. What is the output of System.out.println(Math.sqrt(64)); ?


17. What is the output of System.out.println(Math.sqrt(49)); ?


18. What is the output of System.out.println(Math.sqrt(25)); ?


19. What is the output of System.out.println(Math.sqrt(9)); ?


20. Refer to the previous question. What does Math signify?


21. Refer again to question 19. What does sqrt signify?


22. Refer yet again to question 19. What does the 9 signify?


23. What is a parameter used for?


24. Can Math.sqrt be used without a parameter?


25. List 4 different things that can be passed as a parameter.
.
.
.
.

26. The information, which is passed to a method is called an
_____________ or a _____________.


27. Where are parameters placed?


28. What happens if you alter a program - no matter how slightly - and
then execute without recompiling?


29. The floor, ceil, and round methods of the Math class all "round" in
some way.
What is the difference among them?


30. What is the output of System.out.println(Math.round(7.5)); ?


31. What is the output of System.out.println(Math.round(7.499)); ?


32. What is the output of System.out.println(Math.ceil(7.999)); ?


33. What is the output of System.out.println(Math.ceil(7.001)); ?


34. What is the output of System.out.println(Math.floor(7.999)); ?


35. What is the output of System.out.println(Math.floor(7.001)); ?


36. What is the output of System.out.println(Math.max(100,50)); ?


37. What is the output of System.out.println(Math.min(100,50)); ?


38. What is the output of System.out.println(Math.abs(-3)); ?


39. What is the output of System.out.println(Math.abs(3)); ?


40. What is the output of System.out.println(Math.pow(3,4)); ?


41. What is the output of System.out.println(Math.pow(4,3)); ?


42. What is the output of System.out.println(Math.pow(2,5)); ?


43. What is the output of System.out.println(Math.pow(5,2)); ?


44. Are PI and E "attributes" or "methods" of the Math class?