Unit 1 Review By: Mr. Jacobs
True/False The first generation of programming language is assembly language. True
True/False Java is an example of a high level language. True
True/False Mistakes found early in the coding process are much more expensive to fix than mistakes found later in the process. False
True/False Byte Code is a program that behaves like a computer. False
True/False An arithmetic expression consists of operands and binary operators combined as in algebra. True
True/False Programs manipulate objects by sending them methods. False
True/False An integer is a positive or negative whole number. True
True/False Strings are objects, not primitive data types True
True/False Most, but not all, information in a computer is represented in binary form. False
Fill in the blank OOP stands for _______________. object-oriented programming
Fill in the blank The software responsible for translating a program in a high-level language to machine code is called a(n) ____________. compiler
Fill in the blank JVM stands for _______________. Java virtual machine
Fill in the blank Numbers with a fractional part are called _______________. doubles or floating-point numbers
Fill in the blank When an object receives a message, the object responds by running a block of code called a(n) _______________. methods
Fill in the blank When evaluating an expression, Java performs operations of higher ________ first unless overridden by ____________. precedence, parentheses
Fill in the blank Use the ___________ operator to create a new string out of the existing strings. +
Written Questions What is the purpose of a variable? The purpose of a variable is to store data that can be modified.
Written Questions What are three types of programming errors? The three types of programming errors are syntax errors, run-time errors, and logic errors. An example of a syntax error is the failure to include a semicolon at the end of a statement. An example of a run-time error is an attempt to divide by a variable whose current value is zero. An example of a logic error is a calculation that is off by a factor of 100.
Written Questions Describe the difference between the data types double and int? Type double refers to numbers that have a decimal point. Type int refers to whole numbers.
Assume x = 8 and y = 4 Solve x + y * 2 = 16
Assume x = 8 and y = 4 Solve (x + y) /3 = 4
Assume x = 8 and y = 4 Solve x - y * 3 = -4
Assume x = 8 and y = 4 Solve x + y * 1.5 = 14
Assume x = 8 and y = 4 Solve [(x - y)^(x-y)]/y 64
Write the code Ask the user for their name and enter into a String variable called name. name = reader.readLine(“What is your name?”); System.out.print(“What is your name?”); name = reader.readLine;
What shape is made? Pen.home(); Pen.setDirection(0); For (int i=0; i<5; i++) { Pen.move(100); Pen.turn(72); } Pentagon
Binary What is 10111 as a base 10 number? 23
Binary What is 110001 as a base 10 number? 49
Binary What is 173 as a base 2 number? 10101101