Temperature Conversion Console Application

Temperature Conversion Console Application

My Student Project: C# for Beginners : Assignment #2 (Series)

Permission to publish my code submitted for the project assignment was granted by the professor.

This is a very simple console application that I completed for a class assignment. It is shown here to illustrate my coding style, structure, and commenting. This example is considered Level 1 – Easy. The application displays temperature conversion tables.

Objective:

The main objectives of this assignment were:

  • To exercise with conditional and iteration algorithms
  • To learn how to use string.Format
  • To work with methods having parameters and a return type.

The program displays a list of temperatures in Celsius degrees converted to Fahrenheit and vice versa. A menu is provided for the user to choose the type of conversion: The menu repeats until the user chooses 0 to exit.

When option 1 is chosen, the program calculates and displays a list of values between 0 and 212 degrees in Fahrenheit converted to Celsius degrees as shown in the next image. When option 2 is selected, the program lists values from 0 to 100 Celsius converted to Fahrenheit degrees.

Use the conversion formulas:

F = 9/5 * C + 32

C = 5/9 *(F – 32)

Demos

Option 1 Temperature Conversion Demo

Option 1 Temperature Conversion Demo

Option 2 Temperature Conversion

Option 2 Temperature Conversion

My Solution Code

You can view and download the GitHub repository here.

You can also download a zip archive of the project code here.