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

  Studying the properties of a network

Studying the properties of a network

  Developing an eer schema for database application

Develop an EER schema for a database application which you are interested in. State all the constraints which should hold on the database.

  Distributed data processing

Explain how has the increasing availability of the inexpensive yet powerful personal computers and workstations generated an increasing trend towards distributed data processing (DDP).

  Describe the mechanics of Buffer overflows

Prepare a complete tutorial, including an analogy to describe the mechanics and a graphic to support your analogy, on one of the subsequent areas

  Explain two methods for categorical data conversion

explain two methods for categorical data conversion. List the advantages and disadvantages of this approach.

  Data planning and enterprise modelling

Describe the major differences between two approaches for data planning and enterprise modelling and examine the integration? Why do these two methodologies usually produce several results?

  Baseline for the linux system

Describe briefly the purpose of the baseline. Explain the areas of system would you involve in the baseline for your Linux system?

  Implement needham-schroeder protocol using python

Implement Needham-Schroeder symmetric key protocol, both original version and fixed version using python.

  Write a program based on encryption scheme

Write a program based on encryption scheme.

  Make table to be a pointer to pointer of type double

make table to be a pointer to pointer of type double.

  Find out the retail price for each product

A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; product 5, $6.87.

  Designing the decision table

Design a decision table to represent the kind of treatment to be given to the customer of Eye Tunes Music Club. Produce a structured English version on the basis of following dialogue obtained by Systems Analyst from client interview.

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