wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Graded IB Computer Science Units 1 and 2 Overview

Total questions: 33

Worksheet time: 17mins

Name
Class
Date
1.

The idea that computer memory is filled with 0s and 1s is

a)

an abstraction

b)

an object

c)

algorithmic design

d)

boolean algebra

2.

The main "brain" of the computer is called the

a)

central processing unit (CPU)

b)

primary memory

c)

graphics processing unit (GPU)

d)

register

3.

The smallest working circuit in a computer is called a

a)

logic gate

b)

central processing unit

c)

transistor

d)

vacuum tube

4.

The built in abilities of a processor, such as storing data into registers or adding numbers, are called

a)

logic gates

b)

transistors

c)

primary actions

d)

fundamental operations

5.

Which of the following are parts of the primary memory? (check all that apply)

a)

RAM

b)

ROM

c)

CD-ROM

d)

cpu registers

e)

cache

6.

Which of the following languages have to be compiled to work?

a)

TypeScript

b)

java

c)

javascript

d)

machine language

7.

Which of the following represents a comment in TypeScript?

a)

// comment

b)

# comment

c)

! comment

d)

*/ comment

8.

Which of the following lines declares a function in TypeScript?

a)

function bob(a: string) {

b)

bob("mary");

c)

private bob(a: string) {

d)

let bob: string;

9.

Which of the following lines declares a variable in TypeScript?

a)

function bob(a: string) {

b)

bob("mary");

c)

private bob(a: string) {

d)

let bob: string;

10.

Which of the following lines declares a method in TypeScript?

a)

function bob(a: string) {

b)

bob("mary");

c)

private bob(a: string) {

d)

let bob: string;

11.

Which of the following TypeScript lines would cause errors? (select all that apply)

a)

let a: string = "mary";

b)

let b: "mary";

c)

let i: number = 0 + "b";

d)

let a: integer = 4;

12.

In the typescript function below, what will be the return value if the function is called with parameters 7 and 11?


function fun(a:number, b:number) {

return a * a % b;

}

a)

4

b)

5

c)

11

d)

49

13.

Which of the following are floating point numbers?

a)

-11

b)

43.291

c)

1.58e-3

d)

5

14.

What is the return type and value of the expression


2 + 3 + "11"

a)

type is string, value is "2311"

b)

type is number, value is 16

c)

type is string, value is "511"

d)

type is number, value is 511

e)

trick question - this is an error

15.

What is the return type and value of the expression


"2" + 3 + 11

a)

type is string, value is "2311"

b)

type is number, value is 16

c)

type is string, value is "511"

d)

type is number, value is 511

e)

trick question - this is an error

16.

What is the return type and value of the expression


2 + "3" - 11

a)

type is string, value is "2311"

b)

type is number, value is 16

c)

type is string, value is "511"

d)

type is number, value is 511

e)

trick question - this is an error

17.

Which of the following will make the variable a have a value one larger than it did before? (select all that apply)

a)

a + 1;

b)

a++;

c)

a += 1;

d)

a = a++;

e)

a = a + 1;

18.

Consider the expression


let nums = [1, 2, 3];


What is the index of the 2?

a)

0

b)

1

c)

2

d)

3

19.

Consider the expression


let nums = [1, 2, 3];


What is the data type of nums?

a)

number

b)

number[]

c)

array

d)

int[]

20.

Consider the expression


let nums = [1, 2, 3];


What is the value of nums.length?

a)

0

b)

1

c)

2

d)

3

e)

undefined

21.

Consider the expression


let nums = [1, 2, 3];


What is the value of nums[0]?

a)

0

b)

1

c)

2

d)

3

e)

undefined

22.

Consider the expression


let nums = [1, 2, 3];


What is the value of nums[3]?

a)

0

b)

1

c)

2

d)

3

e)

undefined

23.

Consider the expression


let nums = [1, 2, 3];


What is the value of nums[0].length?

a)

0

b)

1

c)

2

d)

3

e)

undefined

24.

which of the following lines creates a new TYPE of object?

a)

let b = new Ball();

b)

public constructor() {

c)

private Ball;

d)

class Ball {

25.

which of the following lines creates a new INSTANCE of an object?

a)

let b = new Ball();

b)

public constructor() {

c)

private Ball;

d)

class Ball {

26.

A property or method that can be accessed directly anywhere in a program is

a)

private

b)

public

c)

protected

d)

static

e)

constant

27.

A static variable

a)

cannot be modified

b)

is associated with the class rather than an instance

c)

is associated with an instance rather than the class

d)

is accessed with the format ClassName.var

e)

is accessed with the format value.var

28.

This is a(n) _____________ gate

a)

AND

b)

OR

c)

NAND

d)

NOT

e)

XOR

29.

This is a(n) _____________ gate

a)

AND

b)

OR

c)

NAND

d)

NOT

e)

XOR

30.

This is a ___________ gate

a)

AND

b)

NOR

c)

OR

d)

XOR

e)

NOT

31.

This is the truth table of

a)

AND

b)

OR

c)

NOR

d)

NAND

e)

XOR

32.

This is the truth table of

a)

AND

b)

OR

c)

NOR

d)

NAND

e)

XOR

33.

The binary number 10110 is equal to

a)

22

b)

20

c)

14

d)

44