Design program that will read a message string

Assignment Help Computer Engineering
Reference no: EM1332368

Write a JavaScript program that will read a message string and a number from text boxes on a Web page. The program will then use those values to display some information to the user.

Use the JavaScript DHTML Playground to write JavaScript code that performs the following tasks:

- Read a message string from a text box ("Input 1").
- Read a number from a second text box ("Input 2").
- Display, in the page footer, the message string from "Input 1". Repeat the string the number of times your program read from "Input 2". Note: Convert the value from "Input 2" into an integer by using the parseInt() function.

Test the JavaScript code by clicking on the Run button. Submit a Microsoft Word document that contains your JavaScript code. Include a screenshot of the output.

Note: The JavaScript DHTML Playground is at https://javascript.cs.lmu.edu/playground/

My instructor commented on what I did by saying this:

"You are to write JavaScript code to extract information from the form fields 'input1', 'input2', and 'footer'. You do this by looking at the HTML code (the form part). Here is an example of how to do this:

var value1 = document.getElementById("input1");
var value2 = document.getElementById("input2");
var footer = document.getElementById("footer");

You then use the value function to get the value of the field so that you can manipulate it. Next, you will need a for loop to display whatever was stored and accumulate value1 content i.e., inputstring 'count' number of times. For this you need a collector variable i.e., a variable for storing value1 content. This collector variable must be initialized to ' ' i.e.,, empty. You then assign the value of value1 'count' number of times in a for loop.

The last step is to display the result to the footer. The command to do that is as follows:

footer.innerHTML = your_collector_variable;

You should then test your code at https://javascript.cs.lmu.edu/playground/ and see what happens. The value entered in textfield input1 should be displayed 'input2' number of times."

Reference no: EM1332368

Questions Cloud

What legal precedence the ruling sets for most businesses : Accept things as they are - for Jane Harris - Check the issues in the following case study as it relates to the questions asked below. Please provide references.
Procedures of justice system and miranda laws : Many people feel that once an individual is placed under arrest that law enforcement is required to advise that individual of their Miranda rights.
If an investor implemented a reverse cash also carry trade : If an investor implemented a reverse cash also carry trade, what would the arbitrage profit be.
Major challenges are for a management team : George Patton once said the following famous quote: "If everyone is thinking alike, then somebody isn't thinking". With this being said, what do you think are couple other major challenges are for a management team if they think alike and what would ..
Design program that will read a message string : Write down a JavaScript program that will read a message string and a number from text boxes on a Web page. The program will then use those values to display some information to the user.
Illustrate what do you think would the futures price : Illustrate what do you think would the futures price of 100 shares of your reference company to be delivered to you in one year be right now.
Gorden growth model and capm : Select a company which pays dividends, then compute the expected growth rate of your company by using the CAPM.
Measuring effectiveness of diversity in workforce : How might the effectiveness of diversity in a workforce be measured, and what metrics might be used?
Integrated processes and functions : Establish integrated processes and functions across a multicultural company.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd