WorksheetsGraded IB Computer Science Units 1 and 2 Overview
Total questions: 33
Worksheet time: 17mins
The idea that computer memory is filled with 0s and 1s is
an abstraction
an object
algorithmic design
boolean algebra
The main "brain" of the computer is called the
central processing unit (CPU)
primary memory
graphics processing unit (GPU)
register
The smallest working circuit in a computer is called a
logic gate
central processing unit
transistor
vacuum tube
The built in abilities of a processor, such as storing data into registers or adding numbers, are called
logic gates
transistors
primary actions
fundamental operations
Which of the following are parts of the primary memory? (check all that apply)
RAM
ROM
CD-ROM
cpu registers
cache
Which of the following languages have to be compiled to work?
TypeScript
java
javascript
machine language
Which of the following represents a comment in TypeScript?
// comment
# comment
! comment
*/ comment
Which of the following lines declares a function in TypeScript?
function bob(a: string) {
bob("mary");
private bob(a: string) {
let bob: string;
Which of the following lines declares a variable in TypeScript?
function bob(a: string) {
bob("mary");
private bob(a: string) {
let bob: string;
Which of the following lines declares a method in TypeScript?
function bob(a: string) {
bob("mary");
private bob(a: string) {
let bob: string;
Which of the following TypeScript lines would cause errors? (select all that apply)
let a: string = "mary";
let b: "mary";
let i: number = 0 + "b";
let a: integer = 4;
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;
}
4
5
11
49
Which of the following are floating point numbers?
-11
43.291
1.58e-3
5
What is the return type and value of the expression
2 + 3 + "11"
type is string, value is "2311"
type is number, value is 16
type is string, value is "511"
type is number, value is 511
trick question - this is an error
What is the return type and value of the expression
"2" + 3 + 11
type is string, value is "2311"
type is number, value is 16
type is string, value is "511"
type is number, value is 511
trick question - this is an error
What is the return type and value of the expression
2 + "3" - 11
type is string, value is "2311"
type is number, value is 16
type is string, value is "511"
type is number, value is 511
trick question - this is an error
Which of the following will make the variable a have a value one larger than it did before? (select all that apply)
a + 1;
a++;
a += 1;
a = a++;
a = a + 1;
Consider the expression
let nums = [1, 2, 3];
What is the index of the 2?
0
1
2
3
Consider the expression
let nums = [1, 2, 3];
What is the data type of nums?
number
number[]
array
int[]
Consider the expression
let nums = [1, 2, 3];
What is the value of nums.length?
0
1
2
3
undefined
Consider the expression
let nums = [1, 2, 3];
What is the value of nums[0]?
0
1
2
3
undefined
Consider the expression
let nums = [1, 2, 3];
What is the value of nums[3]?
0
1
2
3
undefined
Consider the expression
let nums = [1, 2, 3];
What is the value of nums[0].length?
0
1
2
3
undefined
which of the following lines creates a new TYPE of object?
let b = new Ball();
public constructor() {
private Ball;
class Ball {
which of the following lines creates a new INSTANCE of an object?
let b = new Ball();
public constructor() {
private Ball;
class Ball {
A property or method that can be accessed directly anywhere in a program is
private
public
protected
static
constant
A static variable
cannot be modified
is associated with the class rather than an instance
is associated with an instance rather than the class
is accessed with the format ClassName.var
is accessed with the format value.var
This is a(n) _____________ gate
AND
OR
NAND
NOT
XOR
This is a(n) _____________ gate
AND
OR
NAND
NOT
XOR
This is a ___________ gate
AND
NOR
OR
XOR
NOT
This is the truth table of
AND
OR
NOR
NAND
XOR
This is the truth table of
AND
OR
NOR
NAND
XOR
The binary number 10110 is equal to
22
20
14
44
