Question: Setup a website that looks like this and store it in the q1 folder. The file should be named index.html. Make the title of this

Setup a website that looks like this and store it in the "q1" folder. The file should be named "index.html".

  • Make the title of this page: "(Your Name)'s Rectangle Calculator".
  • Add necessary html documentation using comments. Make sure that you include your name, class number, section number, and the date.
  • Write three functions that return information about a rectangle:
    • The area of a rectangle is height times the width. Name this getArea.
    • The perimeter of a rectangle is 2 times the (height plus width). Name this getPerimeter.
    • The distance between two opposite corners is the square root of the combined height squared and the width squared. (It's the Pythagorean theorem.) Name this getOppositeCornerDistance.
  • Create two input textboxes on the screen for the height and the width of a rectangle.
  • Report to the screen the area, perimeter, and the distance between two opposite corners.
  • Here's how to get points deducted for this problem. In other words, don't do these things in your code:
    • Pull data from the form while inside of any of the three required functions (getArea, getPerimeter, and getOppositeCornerDistance).
    • Reporting data to the screen while inside of any of the three required functions (getArea, getPerimeter, and getOppositeCornerDistance).
    • Leave the parameters blank on any of your three required functions (getArea, getPerimeter, and getOppositeCornerDistance).
    • Not using a return statement on any of your three required functions (getArea, getPerimeter, and getOppositeCornerDistance).
  • Hint: You'll need to craft an additional primary function that pulls data from forms, calls the required functions, and prints data out to the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!