• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

Javascript Practice Exam 1 Testing Mode Questions With Correct Answers | Latest Update

Document preview thumbnail
Preview 2 out of 8 pages

JAVASCRIPT PRACTICE EXAM 1 TESTING MODE QUESTIONS WITH CORRECT ANSWERS | LATEST UPDATE

Content preview

JAVASCRIPT PRACTICE EXAM 1:
TESTING MODE



You have entered the following code into a webpage: <script> function incQty (field)
{ var qty document.getElementById(field).value; qty ++
document.getElementById(field).value qty; } function decQty (field) { qty
document.getElementById(field).value } qt - Correct Answers -Move the qty variable
above the incQty function

Declare the qty variable in the decQty function

You are building a website for a fitness company. You need to display a list of program
dates based on a start date and an end date. You need to build a loop that adds each
date to a bulleted list inside of an element called programList. The start and end dates
are seven days apart, and you need to show all dates in between the start and end
dates. The start date should always display. Using drag and drop, drag over the correct
code snippets in the proper order to build a loop of dates. Any needed variables have
already been declared. Not all options will be used. - Correct Answers -line 1
do {

line 2
document.getElement Byld("programList").in nerHTML += "<li>" + programDate + "
</li>";

line 3
programDate.setDate( programDate.getDate(( ) + 2);

line 4
}

line 5
while (programDate < programEndDate)

You are trying to fill a variable called activity with an activity based on the weather. The
activity to do will be based on the following scenarios: If it is at least 70 degrees and the
weather is clear, the activity will be golf. If it is less than 50 degrees or the weather is
not clear, the activity will be bowling. Otherwise, the activity is hiking. Drag the correct
operators into the missing code slots to finish building this code example. Not every
operator will be used. - Correct Answers -1)>=

, 2)&&
3)==
4)<
5)||
6)!=

You want to store a list of locations in an array, sorted in alphabetical order. You also
want an empty array for new locations, with the intention that the array is filled in with
new locations as needed. Using the dropdown lists, fill in the proper code to declare
both a filled array to the variable, locations, and an empty array to the variable
newLocations. Then, add the code for alphabetizing the locations array before it is
displayed and fill in the code that will make HQ the first element in the array. Finally,
add the code necessary to assign the number of elements in the array to the variable
numberOfLocations. Use the comments to help guide you as to where to add code for
each task. - Correct Answers -[
[]
sort()
[0]
Length

A math expert knows that the area of a circle is PI * the radius squared. However, that
math expert does not know how to code that formula in JavaScript. Using the dropdown
list, fill in the missing code to complete this calculation. - Correct Answers -Math.PI *
Math.pow(radius, 2);

The following code example is almost complete. It just needs comment marks applied to
the areas designated as comments. Using the dropdown arrows, add the correct
comment symbols to finish this code. - Correct Answers -//
/*
*/

You have an external JavaScript file called calculations, located in the scripts folder.
Using the dropdown arrow, insert the proper reference to the script within the head
section of the code example. - Correct Answers -<script src="scripts/calculations.js">
</script>

For each proposed variable name, select Yes if the variable name is permissible in
JavaScript or No if it is not. - Correct Answers -alert Msg NO
$alertmsg YES
alertmsg YES
alert NO
alert_msg YES

As part of a car webpage, a developer is building cars as objects. Each car has multiple
properties. Using the dropdown arrows, fill in the code pieces necessary to build an

Document information

Uploaded on
October 29, 2025
Number of pages
8
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.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.
millyphilip
3.7
(562)
Sold
3013
Followers
1964
Items
47782
Last sold
1 day 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