Question: This is on JavaScript. Part 1 Write a program that displays the dimensions of a letter-size (8.5 x11) sheet of paper in millimeters. The program
This is on JavaScript.
Part 1
Write a program that displays the dimensions of a letter-size (8.5 x11) sheet of paper in millimeters.
The program must include a function, inchesConversion(inches), that accepts a single value in inches, and returns the inches converted to millimeters. The function must also use a constant variable for the conversion factor.
The program must also include a second function, displayOut(), and uses console.log() to display the required formatted output. You will need to call the inchesConversion() function from the displayOut() function to calculate the millimeters in 8.5 inches and 11 inches. The output should be displayed using the console.log() function.
Part 2
Write a program that computes and displays the perimeter of a letter-size (8.5 x 11) sheet of paper. Copy the inchesConversion() function from Part 1
Add a new function, getPerimeter(width, height), to return the perimeter given the specified width and height.
Create a new version of displayOut(width, height) to produce the required output. Modify displayOut() to use the width and height parameters. The output should be displayed using console.log().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
