Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

CodeHS Questions and answers With complete solution 100% pass

Document preview thumbnail
Preview 2 out of 5 pages

CodeHS Questions and answers With complete solution 100% passCodeHS Questions and answers With complete solution 100% passCodeHS Questions and answers With complete solution 100% passCodeHS Questions and answers With complete solution 100% passCodeHS Questions and answers With complete solution 100% pass

Content preview

CodeHS Questions and answers With complete
solution 100% pass

What is the proper function to call to print to the screen? - Correct Answers println
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! What keyword do you need to use to define a variable in JavaScript? - Correct Answers var
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! What function do you need to call to ask the user of the program to enter text? - Correct Answers
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! readLine



II! println(2 + 2); - Correct Answers 4 II! II! II! II! II! II! II!




II! What symbol do you use to do division in JavaScript? - Correct Answers /
II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! What symbol do you use to do multiplication in JavaScript? - Correct Answers *
II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! In the following code, we create a circle and add it to the screen. What is the meaning of the x variable?
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




var x = 20; II! II! II!




var circle = new Circle(x);
II! II! II! II!




add(circle); - Correct Answers The radius of the circle II! II! II! II! II! II! II! II! II!




II! What are the coordinates of the top right corner of the screen? - Correct Answers getWidth(), 0
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! Which of the following is not a valid value for a boolean? - Correct Answers yes
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! What symbol represents the and operator in JavaScript? - Correct Answers &&
II! II! II! II! II! II! II! II! II! II! II! II!




II! What symbol represents the or operator in JavaScript? - Correct Answers ||
II! II! II! II! II! II! II! II! II! II! II! II!

, II! After the following code runs, what is the value of isWeekend?
II! II! II! II! II! II! II! II! II! II!




var isSaturday = true; II! II! II!




var isSunday = false; II! II! II!




var isWeekend = isSaturday || isSunday; - Correct Answers true
II! II! II! II! II! II! II! II! II! II!




II! What is the proper way to compare if two values are equal in a boolean expression in JavaScript? -
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! Correct Answers == II! II!




II! What is the proper operator for "not equals" in JavaScript? - Correct Answers !=
II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! What kind of statement allows us to run a block code only if a certain condition is true? - Correct Answers
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! if statement
II!




II! What kind of statement allows us to run one block of code if one condition is true, and a separate block of
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! code otherwise? - Correct Answers if/else statement
II! II! II! II! II! II! II!




II! How can we check if a variable num is even? - Correct Answers (num % 2 == 0) will be true
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




II! How many times will the following program print "hello"?
II! II! II! II! II! II! II! II!




for (var i = 0; i < 5; i++) {
II! II! II! II! II! II! II! II! II!




II! println("hello");

} - Correct Answers 5
II! II! II! II! II!




II! In the following code, what will be the last number to print to the screen before the program finishes?
II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II! II!




for (var i = 0; i < 10; i++) {
II! II! II! II! II! II! II! II! II!




II! if (i % 2 == 0) {
II! II! II! II! II! II!

Document information

Uploaded on
February 12, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
STUVEX
3.8
(122)
Sold
825
Followers
315
Items
16260
Last sold
6 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions