wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

software dev 1

Total questions: 45

Worksheet time: 23mins

Name
Class
Date
1.
Which of these variables holds numbers with a decimal point?
a)
double
b)
int
c)
String
d)
boolean
2.
Which of these variables holds true or false?
a)
double
b)
int
c)
String
d)
boolean
3.
Which of these is can be used for a switch statement that has a String argument:
a)
case 1:
b)
case one: 
c)
case "1":
d)
case '1':
4.
A variable that holds words
a)
String
b)
boolean
c)
int
d)
float
5.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
6.
An object from what class holds input from the user?
a)
System
b)
Scanner
c)
String
d)
Selena
7.
single line comments, which the computer doesn't read, start with
a)
//
b)
..
c)
**
d)
uppercase letters
8.
Which of these leaves the cursor on the same line as the printed output: 
a)
System.out.print("Hello world.");
b)
System.out.println("Hello world.");
9.
Which of these moves the cursor to the next line beneath the printed output: 
a)
System.out.print("Hello world.");
b)
System.out.println("Hello world.");
10.

block comments, which the computer doesn't read, and begin programs with infortion

a)

//

b)

..

c)

/**

*

**/

d)

uppercase letters

11.

Which means wild card, or 'all the things'?

a)

//

b)

!

c)

*

d)

wc

12.

if - else statement

a)

a loop that iterates, or repeats, until a condition is met

b)

a loop that iterates, or repeats, for a set number of times

c)

decision structure

d)

creates spaces in memory that holds elements all of the same types

13.

comparing two ints

a)

==

b)

this.equals(that)

14.

comparing two strings

a)

==

b)

this.equals(that)

15.

All cases of a switch statement print if:

a)

you forget break statements

b)

you forget a closing curly bracket

c)

you forget a semicolon

d)

you forget a period

16.

This prints if none of the other cases in a switch statement print:

a)

case final:

b)

case default:

c)

default:

d)

error: case not found

17.

The switch statement is

a)

a decision structure that runs only part of our code based on input

b)

an iterative structure that repeats or loops

18.

getting user input: a single word

a)

String response = input.next()

b)

String response = input.nextLine();

c)

int num = input.nextInt();

d)

type a single word, do as I say,

I am the programmer

19.

getting user input: a number

a)

String response = input.next()

b)

String response = input.nextLine();

c)

int num = input.nextInt();

d)

type a single word, do as I say,

I am the programmer

20.

iterate

a)

loop or repeat

b)

choose

c)

dance!

d)

sing!

21.

Every opening { needs a

a)

}

b)

)

c)

]

d)

friend

22.

&&

a)

both things need to be true

b)

at least one needs to be true

c)

none should be true

d)

I've never seen those, are you sure you taught them?

23.

a for loop

a)

an iterative structure that loops at least once

b)

a decision structure that repeats until a condition is changed

c)

an iterative structure that loops a certain number of times

d)

a decision structure that repeats until a condition is met

24.

||

a)

both things need to be true

b)

at least one needs to be true

c)

none should be true

d)

I've never seen those, are you sure you taught them?

25.

!

a)

AND

b)

OR

c)

NOT

d)

RANDOM

26.

an error that's a typo, like a misspelled word or a missing { or ;

a)

logical

b)

syntax

c)

runtime

27.

What does an iterative structure do?

a)

repeat, loop

b)

decided which code should run

c)

what it wants

d)

KungFu

28.

What does a decision statement do?

a)

what it wants

b)

repeat

c)

decide which code should run

29.

Which means 'OR'?

a)

||

b)

&&

c)

==

d)

!

30.

All cases of a switch statement print if:

a)

you forget break statements

b)

you forget a closing curly bracket

c)

you forget a semicolon

d)

you forget a period

31.

a = 2

b = 2

if a == b or a < c:

print('dog')

else:

print('cat')

a)

dog

b)

cat

c)

nothing

32.

smallest to largest

a)

KB

MB

GB

TB

PB

EB

b)

EB

PB

TB

GB

MB

KB

c)

KB

GB

PB

MB

PB

EX

d)

PB

EB

TB

GB

KB

MB

33.

Which file size is used for measuring the size of a movie file? ( .mov )

a)

KB

b)

MB

c)

GB

d)

TB

34.

Which file size is used for measuring the size of a modern hard drive?

a)

KB

b)

MB

c)

GB

d)

TB

35.

Which will print 5?

a)

print(22/4)

b)

print(22//4)

c)

print(22%4)

36.

Which will print 5.5?

a)

print(22/4)

b)

print(22//4)

c)

print(22%4)

37.

Which will print 2?

a)

print(22/4)

b)

print(22//4)

c)

print(22%4)

38.
An object from what class holds input from the user?
a)
System
b)
Scanner
c)
String
d)
Selena
39.

int cats = 2;

System.out.print("cats");

What will print?

a)

cats

b)

2

40.

A bit is

a)

not too much work, just a few problems

b)

The smallest unit of information, can be a 1 or a 0, on or off, true or false

c)

a small amount of dessert

d)

something teeny

41.

int i = 1;

while( i < 3){

System.out.println(i);

i++;

}


What will the printout be?

a)

0

1

2

3

b)

1

2

c)

123

d)

012

42.

int a = 4, b = 3, c = 5;

if( a == b || a < c ){

System.out.println(“star”);

}

else{

System.out.println(“moon”);

}

a)

star

b)

moon

c)

sky

43.

int grade = 78;

grade = grade/10;

switch(grade){

case 8:

System.out.println(“Friday”);

break;

case 7:

System.out.println(“Saturday”);

break;

default:

System.out.print(“Sunday”);

}

What will print?

a)

Saturday

b)

Friday

c)

Sunday

d)

Thursday

44.

for(int i = 0; i <= 4; i++){

System.out.println(i);

}


What will the printout be?

a)

012345

b)

01234

c)

0

1

2

3

4

d)

0

1

2

3

4

5

45.

for(int i = 0; i < 4; i++){

System.out.print(i);

}


18. What will be the last value of i?

a)

6

b)

3

c)

4

d)

5