Question

JavaScript 30. What will be displayed after the following code is entered and run if the...

JavaScript

30. What will be displayed after the following code is entered and run if the user enters "9 am" at the first prompt and "N-215" at the second prompt? If you think there is an error, describe how you would fix it.

function examTime()

{

var time = prompt("What time is the exam?");

var room = prompt("What room is the exam in?");

showIt(time, room);

}

function showIt(a, b)

{

document.write("Your exam is in room " + a + " at " + b);

}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
JavaScript 30. What will be displayed after the following code is entered and run if the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Given the following JavaScript code, what will be displayed on the web page? var x =...

    Given the following JavaScript code, what will be displayed on the web page? var x = 5; var y = 12; while (x < y) {      document.write(x);      document.write("<br>");      x=x+3; }

  • Given the following JavaScript code, what will be displayed on the web page? var i, j;...

    Given the following JavaScript code, what will be displayed on the web page? var i, j; for (i=1; i<=3; i++) {      for (j=2; j<=5; j++)      {            document.write(i+ "," + j + "; ");      }      document.write("<br>"); } 2,3; 3,4; 4,5; 4,6;

  • Given the following JavaScript code, what will be displayed on the web page? var pho =...

    Given the following JavaScript code, what will be displayed on the web page? var pho = new Array(); for (var i = 0; i< 7; i++) {      pho[i] = (i*i) + 3; }            for (var i = 0; i< 7; i++) {      document.write(i + " => " + pho[i] + "<br>"); } 1 => 4 2 => 7 3 => 12 4 => 19 5 => 28 6 => 39

  • Exercise 30 refer to the following code: var vacation = prompt("What do you want to do...

    Exercise 30 refer to the following code: var vacation = prompt("What do you want to do during Spring Break? ↵ Type S for skiing, F for fishing, H for hiking,8 J for learning JavaScript.", " "); if (vacation == 'S') document.write("You should go to Aspen.<br />"); if (vacation == 'H') document.write("Be sure to buy good hiking boots.<br />"); if (vacation == 'F') document.write("Worms make good bait.<br />"); if (vacation == 'J') document.write("You're gonna have soooo much fun!<br />"); 30. Rewrite...

  • This is my code so far: <!DOCTYPE html> <html> <head> <title>JavaScript is fun</title> <meta charset="utf-8" />...

    This is my code so far: <!DOCTYPE html> <html> <head> <title>JavaScript is fun</title> <meta charset="utf-8" /> </head> <body> <script type ="text/javascript"> //declare a variable and store text in it var x = "JavaScript is fun"; //write the variable 5 times document.write(x + x + x + x + x); //store 5 as string in variable x x = "5"; //store 3 as string in variable y var y = "3"; //write the value x + y to the document document.write("<br>");...

  • Please help me with this code for javascript. <!DOCTYPE html> <html> <head> <title>Strings and Arrays</title> <script>...

    Please help me with this code for javascript. <!DOCTYPE html> <html> <head> <title>Strings and Arrays</title> <script> function wrangleArray() { var string1 = prompt("Enter: This class is going to fast");//Must be entered by the user var string1 = "";//Is this right? I want that string to change later by a series of prompt questions document.getElementById("div1").innerHTML = "<p>" + sentence + "</p>"; var words = sentence.split(" ");//I need to convert my string to an Array is this the way to do it?...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • JavaScript (Please debug this code) When a user enters a string in the input box, the...

    JavaScript (Please debug this code) When a user enters a string in the input box, the program is designed to add the string to an array. When the array reaches a certain length, the program displays all the users' entries in a list on the page. When you finish debugging, the user's entry in the input box should be cleared each time the submit button is clicked. Additionally, after five strings are submitted, the entire list of submitted strings should...

  • 1. Given the following code snippet, what is the scope of the variable pen on Line...

    1. Given the following code snippet, what is the scope of the variable pen on Line 1? <script> 1.    var pen = "ball point"; 2.    var pencil = "0.7mm lead"; 3.    function writeIt() 4.    { 5.          document.write(I have a " + pen + " pen."); 6.          pen = "gel ink"; 7.         document.write("You have a " + pen + " pen."); 8.          var pencil = "0.5mm lead"; 9.          document.write("I prefer pencils with " + pencil + "."); 10.   } <script> A. global B....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT