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

  Z-transformation and fourier transformation

Find the z-transform and the Fourier transform of x(n). Find the N-point DFT of x (n) for N=50,10 and 5.

  What are an ethical dilemmas associated

What are the ethical dilemmas associated with using facial recognition software? Is this kind of software any different from a store asking to see your drivers license when you use your credit card.

  Create class complex for working with complex numbers

modify class Complex for working with complex numbers of the form a + bi, where i is square root of -1. Your class must have two overloaded operators for adding and subtracting the complex numbers.

  C program to implement sieve of erastosthenes

Prepare a C program which implements the Sieve of Erastosthenes and determines the primes among the first N integers that you enter through a prompt or the command line.

  Words might appear multiple times in the entered text

write down a program that allows the user to enter a line of text. I then need to use the stringTokenizer to break the input into words. I have to Put these words into a link list and then print them out in alphabetical order.

  Concept of software integration

Explain how hospitals, manufacturing, retailing, education, construction, agribusiness, and shipping are improving efforts with their supply chain through the evolution of software.

  Execute a shell script to read in 3 numbers

Write down and execute a shell script to read in 3 numbers and display which is the largest and which is smallest.

  Thadvantages and disadvantages of using pass by reference

Discuss the pros and cons of static and dynamic allocation of memory in embedded applications. Be certain to address the circumstances under which there might be potential problems.

  Program of five to ten lines in assembly language

Program of five to ten lines in assembly language

  Generating class diagram and pseudocode

Develop a class named CustomerRecord which holds a customer number, name, and address. Incorporate different methods in order to set the values for each data field and output values for each data field.

  Describe the steps to complete the list

Promotion time is coming around the corner. In the last board meeting, your supervisor has asked someone to make a list of tables for a Fernandos Skate Shop customer orders.

  What is the multicast

examine and discuss what the UDP does and its relationship to TCP - - - in what ways is it similar and different, and why (what applications) would we use UDP, and why can't a user program access IP directly.

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