NEW
Font size
WorksheetsGrade 12A Final exam Semester 1
Total questions: 20
Worksheet time: 10mins
In what order do these functions run?
hello(); world(); main();
world(); hello(); main();
main(); hello(); world();
main(); world(); hello();
Which of the following choices is a properly formed JavaScript variable name?
user_age
UserAge
userAge
User age
What is printed if the user enters 5?
5
25
30
50
Which statement reads a number from the user?
let applesToBuy = readLine("How many apples would you like? ");
let applesToBuy = console.log("How many apples would you like? ");
let applesToBuy = readInt("How many apples would you like? ");
let applesToBuy = nextInt("How many apples would you like? ");
A store has 20 apples. How can you store this in a variable?
let numApples == 20;
20 = numApples;
let numApples = 20;
let num apples = 20;
What is the correct keyword to create a constant?
constant
const
let
def
User inputs Florence then Fernandez: What is printed?
Fernandez Florence
Florence Fernandez
FlorenceFernandez
Florence Fernandez
Correct way to name a function that tells the day of the week:
function dayofweek() {}
function day_of_week() {}
function DayOfWeek() {}
function dayOfWeek() {}
What is the result of the binary addition: 1101₂ + 0011₂?
1110
10000
10100
11000
What is the decimal value of the binary number 10110₂?
18
22
26
30
What is the decimal value of the binary number 100011₂?
33
34
35
39
Which of the following is the correct binary representation of the decimal number 37?
100001
100101
101101
1001011
Convert the decimal number 14 to binary.
1100
1110
1010
1001
What does the following code print if the user enters 7?
10
"7 + 3"
73
"10"
What is the value of total?
12
8
16
4
What does this print? (User enters "Sara")
Hello + name!
Hello "Sara"!
Hello Sara!
HelloSara!
Which option correctly declares two variables on separate lines?
let a = 5, b = 10;
let a = 5;
let b = 10;
let a == 5; let b == 10;
What is stored in the variable answer after this code?
A number
A boolean
A string
Nothing
Which line reads a number from the user?
readLine("Enter a number: ");
readInt("Enter a number: ");
input("Enter a number: ");
getNumber("Enter a number: ");
Which of the following correctly declares a variable in JavaScript?
var age = 10;
const age = 10;
let age = 10;
integer age = 10;
