Temperature Table
Part of the PowerShell Basics section of Coddy's PowerShell journey. Lesson 26 of 28.
Challenge
MediumPrint a Celsius to Fahrenheit conversion table.
- Read three whole numbers with the prompts
Start,EndandStep. - If the step is 0 or less, print
Step must be positiveand nothing else. - 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 andF. Fahrenheit is Celsius times 9, divided by 5, plus 32. - 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: 3Try it yourself
# Read the start, the end and the step, then print the table
All lessons in PowerShell Basics
5Project: Password Checker
Project OverviewLength Check