Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program, using either a for-loop or a while loop, and the document.write

ID: 3637955 • Letter: W

Question

Write a program, using either a for-loop or a while loop, and the document.write() method, that when a button is clicked on the first page, a function is called that writes a new page to the browser window. The new page should be an html table of Celsius temperatures and their Fahrenheit equivalents. The Celsius temperatures should begin at 0 degrees, and each row in the table should increment by 10 degrees C, up to a maximum Celsius value of 100.

If it were me, I would use a for-loop, with a starting (initial) value of degC=0, and use the increment for the loop to be 10, something along the line of

degC= degC 10.

To get full credit the new page you generate needs to be correct with regard to the html (i.e., all basic tags, generated with document.write() outside of the loop), the table itself and the values in it must be generated by a loop. No fair writing the table and its values without using a loop.

Explanation / Answer

/* * Display Fahrenheit to Celsius Conversion table * for 0°F to 100°F in steps of 10°F. */ var lower = 0; // lower limit of Fahrenheit temperature var upper = 100; // upper limit of Fahrenheit temperature var step = 10; // increment of Fahrenheit temperature var fahrenheit; // current Fahrenheit temperature var celsius; // current Celsius temperature fahrenheit = lower; for( ;fahrenheit
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote