The objective for today's lab is to investigate
Conditional programming.
This program prompts the user for a length and
width of the house and then computes the perimeter of the house
- Create a web page with
- 3 text boxes: length, width, and perimeter
- a button - "Go!"
- div tags with ids that will be used to display the Error
messages if an invalid value is entered
- Create a Javascript function that
accepts and validates the length and width of the house
- Use conditionals to verify the width and if invalid:
- place
an appropriate error message in the innerHTML of the corresponding
div tag
- Have the error message be in ref font
- and do not calculate the perimeter
- They both need to be numbers
- House length cannot be less than 24
- House length cannot be bigger than 75
- House width cannot be less than 36
- House width cannot be bigger than 100
- Calculate the perimeter: 2*(length_of_house+width_of_house)