Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Javascript Question #1 Write an event handler so that when the user clicks the Press to Count button a function executes. The function should get

Javascript

Question #1

Write an event handler so that when the user clicks the Press to Count button a function executes. The function should get the sentence and the letter from the textboxes and determine how many times the letter appears in the sentence (both upper and lowercase). The function should print the count to the html page. See the screen shot above for sample output.


Question #2

Write an event handler so that when the Press to Enter button is clicked, a function executes. The function should prompt the user to continuously enter numbers until a negative number is entered. Once a negative number has been entered, you should then print the average of all the entered numbers to page. If the user does not enter any non-negative numbers (i.e., they only enter one number and its negative), you shouldinstead print an error message to the page. You must use a do while loop to solve this problem.


Question #3

Write an event handler so that when the Press to Display Nums button is pressed a function executes. The function should get the two numbers entered in the textbox, make sure the numbers are valid, then determine which number is the larger, and print the numbers from the smallest number up to the largest number back onto the page.

Question #4

Write an event handler so that when the Press to Display Pattern button is pressed a function executes. The function should get the number entered in the textbox, make sure the number is less than 100, and print the following pattern back onto the page: ....1 ...2. ..3.. .4... 5.... where the number of rows and columns in the pattern is equal to the number entered by the user. image text in transcribed
image text in transcribed
Enter a sentence: Enter a letter: Output will appear here Question 2 The average of the numbers you enter will appear here Question 3 Enter first num: Enter second num: The numbers from first num to second num will appear here Question 4 Enter the number of rows that should appear in the pattern: We will display the pattem here Question 1 Enter a sentence: Enter a letter. The letter e appears 2 times in the string mischief managed Question 2 The average is 4 Question 3 Enter first num: Enter second num: 5678910 Question 4 Enter the number of rows that should appear in the pattern: .1 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is privatization?

Answered: 1 week ago

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago