Part 3: JavaScript - Program Outline, Startup Function, and Prompt We are going to use a function that we can consider an entry point into our running JavaScript. Below is an outline of the major elements in our JavaScript file. getRandomInt() function: generate a random integer startup() function: entry point function call to startup() function Below is your startup code: function getRandomInt(min, max) {} function startup() {} startup(); >> Add the above code components to your cis111-07.js JavaScript file below your multiline comment. >> Copy the getRandomInt function code from your previous assignment, or from this Stackoverflow article (Links to an external site.). Remember to add a single line comment above the getRandomInt function that documents the source of the code. Before attempting to use the prompt function in your code, you should try out the function in the console. >> Enter the following into the console to test displaying the prompt dialog. prompt(); Prompt can include an optional text prompt. >> Enter the following into the console to display a text prompt in the prompt dialog. prompt("Enter data:"); The prompt function will return whatever was typed into the prompt dialog. >> Enter the following into the console to store and display the user-input into the prompt dialog. let input = prompt("Enter data:"); Now that you're familiar with how prompt works, let's add prompt to our startup function. >>  Add the prompt function to the startup function, using appropriate prompt text. Capture the input returned from the prompt function into a variable.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Part 3: JavaScript - Program Outline, Startup Function, and Prompt

We are going to use a function that we can consider an entry point into our running JavaScript. Below is an outline of the major elements in our JavaScript file.

  • getRandomInt() function: generate a random integer
  • startup() function: entry point function
  • call to startup() function

Below is your startup code:

function getRandomInt(min, max) {}

function startup() {}

startup();

>> Add the above code components to your cis111-07.js JavaScript file below your multiline comment.

>> Copy the getRandomInt function code from your previous assignment, or from this Stackoverflow article (Links to an external site.). Remember to add a single line comment above the getRandomInt function that documents the source of the code.

Before attempting to use the prompt function in your code, you should try out the function in the console.

>> Enter the following into the console to test displaying the prompt dialog.

prompt();

Prompt can include an optional text prompt.

>> Enter the following into the console to display a text prompt in the prompt dialog.

prompt("Enter data:");

The prompt function will return whatever was typed into the prompt dialog.

>> Enter the following into the console to store and display the user-input into the prompt dialog.

let input = prompt("Enter data:");

Now that you're familiar with how prompt works, let's add prompt to our startup function.

>>  Add the prompt function to the startup function, using appropriate prompt text. Capture the input returned from the prompt function into a variable.

Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY