Menu
CoddyTech

Temperature Table

Part of the PowerShell Basics section of Coddy's PowerShell journey. Lesson 26 of 28.

challenge icon

Challenge

Medium

Print a Celsius to Fahrenheit conversion table.

  1. Read three whole numbers with the prompts Start, End and Step.
  2. If the step is 0 or less, print Step must be positive and nothing else.
  3. Otherwise print one row for every Celsius value from the start, adding the step each time, while the value is at most the end. A row is the Celsius value, C = , the Fahrenheit value with 1 decimal and F. Fahrenheit is Celsius times 9, divided by 5, plus 32.
  4. After the rows, print Rows: and the number of rows (which can be 0).

With the input -5, 5 and 4, your script prints:

Start: -5
End: 5
Step: 4
-5 C = 23.0 F
-1 C = 30.2 F
3 C = 37.4 F
Rows: 3

Try it yourself

# Read the start, the end and the step, then print the table

All lessons in PowerShell Basics