2

ITP100 Mid-Term (Closed Book Review Questions Ver. 10-16) Name: ______

1. The following button is used to run a Greenfoot program.

2. In Greenfoot classes can be made into ______using the constructor.

3. The only language a computer can understand is ______.

4. Can you animate objects in Greenfoot?

5. The flowchart symbol for a decision (conditional if) is a(n) ______.

6. The flowchart symbol for input/output is a(n) ______.

7. The ______is used to start and stop the flowchart.

8. Should flow lines be obvious in the flowchart and always indicate direction?

9. Can the comment be used in a flowchart?

10. Can you export an application in Greenfoot, and allow the user to execute this program without having Greenfoot installed on their machine?

11. When compiled, and syntax errors exist, where are they displayed?

12. An algorithm is a set of instructions that a programmer can translate into ______.

13. Can you use the speed slider to alter the speed of a program while it is running?

14. How can an instance of a crab be interactively placed into the world?

15. A(n) ______is a sequence of steps that must be taken to perform a task.

16. A computer ______is a set of instructions that a computer follows to perform a task.

17. If any source code is changed, what must be done prior to running these changes?

18. What is considered good programming practice for naming instances or objects of a class?

19. Pseudo code is written in the following language:

20. Which of the following structures are used to add explanatory notes into a method?

21. Is the semicolon mandatory in this line: if(a < b);

22. Is the semicolon at the end of this line mandatory? for(int i = 0; i <11; i = i + 1);

23. Is the semicolon at the end of this line mandatory? while( i 11);

24. Using this structure: while (x < 11), is it necessary to use a counter such as x = x + 1 to

increment the loop counter? What would happen if you left it out?

25. What are the three distinct types of comments that a programmer can use? Hint: // (line comnt.)

26. Is the use of comments in a Java source code considered good programming practice? Why?

27. The pseudo code describes the ______in the logic. The source code is the ______.

28. Pseudo code is written in the ______language.

29. These symbols: ______are used in Java to insert explanatory comments beside source code.

30. Which of the following variable types can hold a value of either true or false?

31. Which of the following variable types should be used to store someone’s age?

32. Will the constructor have a return type?

33. A ______is a sequence of characters and is used to store text.

34. String sVar = "Hello"; In this line is the String a class name?

35. Are there are any keywords in this statement? Which ones? private int number = 0;

36. Can keywords be used to name variables?

37. Can variables be used as an index for the element number within an array?

38. It is possible to put a conditional if statement within a loop?

39. Can we correctly use the keyword private this way: int private = 10;

40. Can keywords ever be used to name variables?

41. How can you tell a method from a variable? An example of each is shown for clarity.

42. Assuming that a = 2 and b = 3, which of the following expressions is true?

43. Assuming that a = 3 and b = 3, which of the following expressions is true?

44. Assume the same variables in #42. What is the console output of this source code:

if ( a == b )

System.out.println("Yes");

System.out.println("No");

45/46. What is the decimal number ______expressed in binary?

47/48. What is the binary number ______expressed in decimal?

49/50. What is the hexadecimal number ______expressed in binary?

51. An object can have ______and methods.

52. Machine language instructions are written in what language that computers understand?

53. Which of the following is used to add a crab object to a Greenfoot world?

54. When an object is turned, using the turn(4) method, it turns (how)?

55. When you want the lobster to turn 10 degrees, 20 percent of the time, use this line:

56. The act button causes how many act methods to run in a Greenfoot program.

57. Are constructor names necessarily the same name as the class?

58. Can a Class be inherited from another Class? What does the “is-a” relationship show?

59. What do the initials in the Greenfoot API represent?

60. Have we already been allowed to call a static method from another class?

61. Misspelled keywords, missing punctuation characters, and other such errors are called ______errors.

62. The Greenfoot ______may be used to create, edit, and compile methods.

63. The ______button is used to run an act method over and over.

64. In programming terminology, an object is said to be a(n) ______of a class.

65. When an object turns right, the parameter is always a ______number.

66. The super (560, 300, 1) is used to ______.

(in your description please describe what each parameter means)

67. Are pseudo code and flowcharting the tools used by the computer when running the programs.

68. When "calling" a method, it is necessary (or correct) to use the return type in the call, itself.

69. When "calling" a method, it is necessary (or correct) to use either variables or numbers as parameters if the method takes two arguments.

70. The programming terminology for executing a method is ______a method.

71. Additional information to a called method is provided via one or more ______.

72. The ______method is used to change the direction an object is facing.

73. The ______method is used to move an object.

74. The ______structure is used to execute one or more conditional instructions if the condition is true.

75. The ______structure is used to execute one or more conditional instructions if the condition is true, and other instructions if the condition is false.

76. The ______conditional structure is used to execute one or more conditional instructions inside another conditional instruction(s).

77. What is the name of the operation that joins two strings together?

78. What key word is used to indicate that a variable can only be used within that class?

79. Which of the following belongs to a specific object?

80. Given that the variable days of type int has a value of 13, the following expression would evaluate to what value? days / 7

81. What is the name of the special method that allows you to add text to a world?

82. Constructors may have how many parameters?

83. The assignment symbol is the ______.

84. What is the meaning of this in java? (5 == 5)

85. What is the correct test symbol(s) to test for two items not being equal.

86. If a = 6 and b = 6, then what does (a != b) evaluate to?

87. What is one way to create an array of Strings as capital letters from "A" through "E"?

88. In Java how do we write the third element in the array named key?

9

89. A(n) ______variable holds an argument that is passed to a method.

90-96. Write the correct code for the act method (already defined inside the Crab class) to turn

right four degrees when the right arrow key is pressed and turn left four degrees when the

left arrow key is pressed.

97/98. Given that the variable int hours has a value of 10, the following expression would evaluate

to what value? hours / 5 + 2

99/100. Assume that a = 1, b = 2, and c = 3. What is the value of the expression: (a < b) & (b > c)?