Northcentral Technical College Introduction To Programming
10-152-310
Introduction to Programming with JavaScript NTC 10-152-310

Learning Plan 5 Fahrenheit-Celsius Conversion

# Example: Fahrenheit-Celsius Conversion

#### File: /Learning Plan 5/example1.html

### Problem Statement

> A program is to be written that will accept 5 Fahrenheit temperatures, convert each one to Celsius, and display the converted temperatures on the page. After all 5 have been processed, the program will display the words, "All temperatures processed." on the page.

### Program Planning Lists

- In the following pre tag, write the three planning lists based on the verbs and nouns you see in the problem statement.

    The List of Input Variables:
        currentFahrenheitTemperature
        finalMessage

    The List of Output Variables:
        currentFahrenheitTemperature
        currentCelciusTemperature
        finalMessage

    The Process Checklist:
        prompt user for 5 temperatures in a loop
        convert the inputs to numbers
        display each input temperature
        display each converted temperature
        display finalMessage

### The Test Plan

    TEST CASE 1:

        INPUT VALUES: 212

        EXPECTED RESULT: 100

    TEST CASE 2:

        INPUT VALUES: 32

        EXPECTED RESULT: 0

    TEST CASE 3:

        INPUT VALUES: -40

        EXPECTED RESULT: -40

### 5. JavaScript Output

> Write the JavaScript code based on everything you've done.

- Here's the code:

- Here's the output: