68
ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random Numbers, Scanner Input }

ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Embed Size (px)

Citation preview

Page 1: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

ReviewNum1 {

Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic,

Print Statements, Errors, Boolean Expressions,

Conditionals, Loops, Random Numbers, Scanner Input }

Page 2: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Rules: 30 second time limit.You must cycle through team players.Done once you put pen down with cap on.You may ask your team for help.You may look at the notes at any time.Disqualified if you copy an answer.

Disqualified = -2Wrong Answer = -1No Answer = 0Correct Answer = +1First Correct = +2

Page 3: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Ready?

Page 4: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

System.out.print(“Review”);System.out.println(“Day”);

Page 5: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

unsigned binary number?

1101

Page 6: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write a while loop that would print this output:

0 1 2 3 4

Page 7: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

In 3-bit unsigned, what is the largest possible value

we can represent?

Page 8: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

binary number in sign and magnitude?

1000

Page 9: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component reads CDs, DVDs, and

Blurays?

Page 10: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

How do we write the Java logical operator “AND”?

Page 11: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What binary complement system requires that you

flip all of the bits and then add one to map negative

numbers?

Page 12: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

int x = 20;while (x <= 100) {

x = x + 5;}System.out.print(x);

Page 13: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What binary complement system requires that you flip all of the bits to map

negative numbers?

Page 14: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

double y = 13.7;System.out.print(y < 11.3 + 2.5);

Page 15: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Fill in a value for X to make the expression TRUE

int x = _____;

if ( ( x > 5 ) && ( x != 6 ) ) {…

Page 16: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

If you are missing a close curly brace “}” somewhere

in your code, what error will you get?

Page 17: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

How do we write the Java relational operator “equal

to”?

Page 18: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the name of this Java arithmetic operator?

%

Page 19: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

binary number in sign and magnitude?

1100

Page 20: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

When you plug a USB drive into your computer, what part is it being plugged

into?

Page 21: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What symbols do we write in code to start writing a

comment?

Page 22: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component is the main printed circuit board in your computer?

Page 23: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

unsigned binary number?

0110

Page 24: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write a while loop that would print this output:

100500

Page 25: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

How do we write the Java relational operator “not

equal to”?

Page 26: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component performs all of the arithmetic for your

computer?

Page 27: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Fill in the missing code to get user input from this scanner and store it into the integer x.

Scanner scan = new Scanner(System.in);int x = ______________________

Page 28: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What Java variable type stores decimal numbers?

Page 29: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the line of code that will import the user input scanner in Java?

Page 30: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

List all possible random numbers that could be stored in the integer

myRand.

int myRand = rand.nextInt(4);

Page 31: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component stores permanent data without containing any

moving parts?

Page 32: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

How many bytes are in one kilobyte? Hint: 210

Page 33: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

In 4-bit unsigned, what is the largest possible value

we can represent?

Page 34: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

System.out.println(“Test”);System.out.print(“Friday”);

Page 35: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Fill in a value for Y to make the expression FALSE

int y = _____;

if ( ( y < 5 ) || ( y > 6 ) ) {…

Page 36: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

How do we write the Java logical operator “OR”?

Page 37: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

System.out.println(“Study”);System.out.print(“Your”);System.out.println(“Notes”);

Page 38: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Fill in the missing code to get a random number from 0 to 999 from this generator and store it into the integer x.

Random rand = new Random();int x = ______________________

Page 39: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

int y = 100;while (y >= 0) {

y = y – 100; System.out.print(y);}

Page 40: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

In 4-bit using Two’s Complement, what is the

smallest possible value we can represent?

Page 41: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the best cooling system for your CPU?

Page 42: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Fill in the missing code to complete the initialization of the

scanner.

Scanner scan = new Scanner(______);

Page 43: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component stores permanent data on a

spinning disk?

Page 44: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the result of this unsigned binary addition?

0101 + 0111 = ____

Page 45: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What do we call it when a binary addition produces a

result that passes the greatest possible

representation that a number of bits could store?

Page 46: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What two things do you need to install on your

computer to start programming in Java?

Page 47: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the result of this unsigned binary addition?

0110 + 0011 = ____

Page 48: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

binary number in sign and magnitude?

0111

Page 49: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Before executing any code, the code must first be

transformed into 0’s and 1’s, which is also known as?

Page 50: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

System.out.print(“Fun”);System.out.println(“ ”);System.out.print(“Day”);

Page 51: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component stores data quickly but temporarily for loading

programs and data?

Page 52: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the result of this unsigned binary addition?

0110 + 0110 = ____

Page 53: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

List FOUR output devices from a computer.

Page 54: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

If you wanted to have many monitors plugged into your computer, you would need multiple of this component.

Page 55: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

List FOUR input devices to a computer.

Page 56: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What hardware component changes AC electricity into

DC for your other components?

Page 57: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What does JDK stand for?

Page 58: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

int x = 5;while (x > 0) {

x = x – 1;}System.out.print(x);

Page 59: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

String player = “Bob”;

System.out.println(“player”);System.out.println(“Bob”);System.out.print(player);

Page 60: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

unsigned binary number?

1011

Page 61: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the base-10 representation of this

binary number in sign and magnitude?

1011

Page 62: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is the line of code that will import the

random number generator in Java?

Page 63: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What does PCB stand for in computer hardware?

Page 64: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What does IDE stand for?

Page 65: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What binary compliment system do almost all

computers and programming languages

use?

Page 66: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

Write the output of the following code:

int x = 7;System.out.print(x != 7);

Page 67: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What binary compliment system requires an end-

around carry for additions to produce the correct

result?

Page 68: ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random

What is your computer science teacher’s name?