C# Loops - Applications

 

Celsius to Fahrenheit Table - Part 1

Let’s put the loop to work with a simple application.  And with that application let’s explore the concept of Problem Analysis.   We may be tempted to just jump in and start coding but without understanding what  you are trying to accomplish the results will probably not be what you had in mind.

We’ll start with a program that creates a list of Fahrenheit temperatures based on a sequence of
Celsius temperature.  In other words we’ll use a loop to step through the Celsius temperatures and calculate the Fahrenheit equivalent with each pass.

Celsius to Fahrenheit Table - Part 2

We’ve done our analysis and we’ve designed our solution by flow charting the process.  We have a plan.  It’s just a matter now, of following our plan as we write our code. 

In the video you will notice that I used the flowchart as a guide.  When it came to writing the code I deviated a bit as needed.  In fact not everything was in the flowchart.  Display F and C said nothing about how.  It didn’t have to.  How the temperatures were to be displayed was up to the programming on just how.  Yes, the problem stated to use list boxes but the programmer could use something else if warranted.  The flowchart is temporary.  It’s just a guide.