• 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 4 out of 47 pages
Exam (elaborations)

Javascript Full Solution Bundled Assessment Questions And Correct Answers

Document preview thumbnail
Preview 4 out of 47 pages

JAVASCRIPT FULL SOLUTION BUNDLED ASSESSMENT QUESTIONS AND CORRECT ANSWERS

Content preview

JAVASCRIPT FULL SOLUTION BUNDLED
ASSESSMENT QUESTIONS AND CORRECT
ANSWERS

●● 6.2 In the following line, the word writeln is a(n) _________ that
performs a task or action in the script.
document.writeln("Hello World");
a) structure
b) collection
c) object
d) method
Answer: d) Method


●● 6.3 Consider the following HTML5 code.
<html>
<script type = "text/javascript">
<!--
<!-- document.writeln("Hello World"); -->
//-->
</script>
</html>

,What would a browser capable of scripting display when executing this
code?
a) document.writeln("Hello World");
b) nothing
c) Hello World
d) <html>
<script type = "text/javascript">
<!--
<!-- document.writeln("Hello World </p>");
//-->
</script>
</html>
Answer: b) Nothing


●● 6.4 Which of the following statements would correctly print out the
sentence "Hello World" in blue?
a) document.write( "<p style = \"color: blue\");
document.write( "Hello World >");
b) document.write( "<p> style = \"color: blue\" Hello World </p>);
c) document.write( "<p style = \"color: blue\" Hello World + "</p>");
d) document.write( "<p style = \"color: blue\">");
document.write( "Hello World </p>");
Answer: d) document.write( "<p style = \"color: blue\">");

,document.write( "Hello World </p>");


●● 6.5 An alert dialog displaying the text "Welcome!" is created by
calling _________.
a) window.alert( "Welcome!" );
b) alert.window( "Welcome!" );
c) window( "alert = \"Welcome!\"" );
d) window( "<alert> Welcome! </alert>" );
Answer: a) window.alert( "Welcome!" );


●● 6.6 Consider the following script. What is wrong with the following
code?
<script type = "text/javascript">
var firstNumber;
thirdNumber;


firstNumber = window.prompt("Enter an integer", "0");
secondNumber = window.prompt("Enter an integer", "0");
thirdNumber = firstNumber + secondNumber;
</script>


a) thirdNumber in line 7 must be in quotes.
b) The words Enter an integer in line 6 should not be in quotes.

, c) The word thirdnumber in line 3 should have a comma after it.
d) The word var must be placed before thirdNumber in line 3.
Answer: d) The word var must be placed before thirdNumber in line 3.


●● 6.7 Which of the following is not a valid variable name?
a) Tax1
b) eightball_8
c) 12footage
d) pageNumber1200
Answer: c) 12footage


●● 6.8 What will the browser display if the following script is executed
and the user enters 5 at both prompts?
<script type = "text/javascript">
<!--
var firstNumber = window.prompt( "Enter an integer", "0" );
var secondNumber= window.prompt( "Enter an integer", "0" );
var thirdNumber;
thirdNumber = firstNumber + secondNumber;
document.write( thirdNumber );
//-->
</script>

Document information

Uploaded on
July 5, 2026
Number of pages
47
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

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.
Favorgrades
3.8
(200)
Sold
863
Followers
376
Items
61590
Last sold
3 days 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