All projects

TEMP-CONVER

TEMP-CONVER v1.0 is a C++ command-line temperature converter. Its menu supports all six conversion directions between Celsius, Fahrenheit, and Kelvin.

Language
C++
Release
v1.0
C++ source showing the conversion constants, output precision, and menu loop
The v1.0 C++ source sets two-decimal precision and prints the conversion menu inside a loop.

How it works

Choose a conversion

The startup menu lists Celsius to Fahrenheit, Fahrenheit to Celsius, Celsius to Kelvin, Kelvin to Celsius, Fahrenheit to Kelvin, and Kelvin to Fahrenheit. Enter the number for the direction you want.

TEMP-CONVER v1.0 startup menu with six conversion options and Exit (0)
The startup menu waits for a numbered choice.

Enter a temperature

The program prompts for a temperature in the selected source unit, applies the conversion formula, and displays the result to two decimal places. It then shows the menu again so you can run another conversion.

Option 1 converts 100.00 Celsius to 212.00 Fahrenheit before returning to the menu
Entering 100 Celsius produces 212.00 Fahrenheit and returns to the menu.

Exit the program

Select Exit (0) at the menu to end the loop. The program prints a closing message and returns to the terminal.

Entering 0 displays the exit message and thanks the user
Option 0 ends the session.
All projects