Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Enter Script and Fix Error (10 points) Enter and test this script; it has two errors in it. For this program, you may cut

2. Enter Script and Fix Error (10 points) Enter and test this script; it has two errors in it. For this program, you may cut and paste the lines into your source editor. By the way, be very careful when cutting and pasting source code, the double quote character () is often mangled. Note this code uses the single quote (), which is usual less of an issue. Hints: (1) Turn on your browsers console to see the error messages, and (2) there are two errors. Try looking for spelling errors and missing characters.

3. Write Your Own Script #1 (10 points) Using the above scripts (which are HTML pages) as models, write a script that stores 55 is a variable called age and the increments the age by 1 using the ++ operator. Finally, the script should output the new age. Both of our textbooks touch on the ++ operator and you can also learn more about it using Google/Bing. With Chrome, a correct output from this HTML page and script might look like: 4. Write Your Own Script #2 (10 points) Using the above scripts as models and the JavaScript prompt method, write a simple script that will prompt the user for a number and then reply back to the user that the number is or is not equal to 2. You will need to define a variable with var (the name of the variable is up to you), prompt to get a value into the variable, and then use an if statement to see if the variable is equal to 2. Finally, you can use the alert method to output equal 2 or not equal 2. Some Hints: a. The optional texts chapter 9 covers the prompt method. There are also lots of prompt examples available via Google/Bing. b. The if statement is covered in our main textbook, in the optional text, and in many examples available via Google/Bing. c. If you have never programmed before, this problem might be rather intense. If you run out of time, turn in what you have started for partial credit. In about 2-3 weeks, you will look back and see this problem as trivial. Honest! With Chrome, correct results from this HTML page and script might look like:

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago