Create a function called checkage which has the if statement

Assignment Help Computer Engineering
Reference no: EM133369960

Part 1 : Web Page with a Script Tag

As you did in the previous coding assignments, web page called <first_name>_<last_name>_hw4.html

For instance, I would create a file called:

Antonino_Cacioppo_hw4.html

and then create a simple HTML document with a single header1:

<H1>PART 1: Simple FOR Loop</H1>

<output of your loop>

<H1>PART 2: Simple FOR Loop with IF Condition</H1>

<output of your loop>

<H1>PART 3: Simple While Loop with IF Condition</H1>

<output of your loop>

<H1>PART 4: Simple While Loop with IF Condition using a Function</H1>

<output of your loop>

----- FORMAT ABOVE ----

Part 2 : Replace the Javascript Code in Web Page

PART 1: Simple FOR Loop (3 point)

loop from 1 to 25 and write the output with the loop count. Use the i variable for each loop.

The following is the code you want to put in your loop:

document.write("THIS IS THE FOLLOWING LOOP NUMBER: " + i + "<br");

where i is the variable you are using in your for loop.

PART 2: Simple FOR Loop with IF Condition

 loop from 1 to 25 and write the output with the loop count using age is the loop counter.

Add an IF block to check if the age is less than 18, if so, print the following:

document.write("Your age is " + age + " and you are not able to vote<br");

If the age is equal to or greater than 18, then print:

document.write("Your age is " + age + " and you are able to vote, so vote !!!<br");

PART 3: Simple While Loop with IF Condition

Do the same thing as Part 3 except use a while loop instead. Feel free to use the age variable or new 

Do the same as part 3 but instead create a function called checkAge which has the IF statement with the age check and the document.write call.

Pass in the age of your loop into the function.

Reference no: EM133369960

Questions Cloud

Mock interview in optimal resume~interview : List the two hardest interview questions you encountered during the mock interview in Optimal Resume~Interview
Business may be affected by six environmental factors : Explain how your business may be affected by the six environmental factors? Which factor or factors might have the biggest impact on your business?
What impact do you think this would have on this company : CSC 1014 Cambrian College What impact do YOU think this would have on this company? What do YOU think the company could have done to avoid this breach?
Associated with job description : In an organization with each of these financial positions, which title is most likely to be associated with a job description that is less of a "hands-on" manag
Create a function called checkage which has the if statement : create a function called checkAge which has the IF statement with the age check and the document.write call.
Potential short-term consequences : Make a recommendation based on your analysis. Be sure to include potential short-term consequences and long-term consequences of your decision.
Which court heard the case and who was the judge : Find the court decision located at 144 T.C. 279. Which court heard the case? Who was the judge(s)? In what year was the case decided?
What do you think would help you understand those topics : what do you think would help you understand those topics better? What questions do you still have about system or software architecture
Method for assessing the security threats : method for assessing the security threats that have been discovered fonzy esses. Mogadon. Define anske option strategy and put security controls

Reviews

Write a Review

Computer Engineering Questions & Answers

  Calculate and display a contestants score

A performer's final score is determined by dropping the highest and lowest score received, then averaging the 3 remaining scores.

  Questioncustomer id number name varchar10001 akash

questioncustomer id number name varchar10001 akash kumar10002 vijay chopra10003 rahul mishratransactionsid number

  Suppose that a vector processor has a memory system in

suppose that a vector processor has a memory system in which it takes 10 cycles to load a single 64-bit word from

  Calculate c with various sets of values for a and b

Even if we were to declare variables a and b as integers, why might we still need to declare c as a ?double?

  What are possible benefits that the projects offer

Research information about two current data mining projects being conducted. What are possible benefits that these projects offer?

  How are data and information systems categorized

How does the NIST risk management framework 3-tiers ensure information security (NIST SP 800-53, revision 4)? How are data and information systems categorized?

  Drawbacks of supporting links to files that cross mount

explain the advantages and disadvantages of supporting links to files that cross mount points (that is, the file link refers to a file that is stored in a different volume).

  Examine the practicality of building multiple interface

Examine the practicality of building multiple interface options for diverse populations, rather than building one interface that meets the needs of the majority of end users.

  How the shift alters the optimal total cost

Construct a table to show, for shift amounts up to 15,000 square feet, how the shift alters the optimal total cost.

  Discuss current methodologies used to secure wired networks

Discuss the current methodologies used to secure wired or wireless networks via current Firewall technologies and the potential exposures that currently exist.

  What if the size of the usb flash drive is increased

You also have an LTE data card that connects to your portable computer and receives data any where you're located at a rate of 50 Mbps.

  What is name of a virus that changes itself when it spreads

What is the name of a virus that changes itself when it spreads? Which of the following options is a useful defense against database attacks?

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