Lab#1 Tempature Conversion Program (due: 9/17)
In this lab, we are going to use the graphical features of C# to create a temperature conversion program.
Your finished program should look something like this.

Dr. Armstrong

The conversion occurs when the user presses one of the buttons at the
button of the program window. The should already have entered their
Fahrenheit or Celsius value.


video Video showing how to setup and save in C#

*** If you didn't understand the video, here is a tutorial showing how to setup and save in C#.

In addition, you will need these code snippets to help you along.
1) Add this routine, as a method inside the Form1 class of your program code.
public bool IsNumeric(string s)
{
   try
   {
     Double.Parse(s);
   }
   catch
   {
     return(false);
   }

   return(true);
} 
2) Here are the two videos, you'll need to follow, to complete this lab...

video Video showing how to add "tools" to your form in C#

video Video showing how to write the first part of your program.


You need to bring in the data from the text box, do your calculaton and display your result, like:

  float yards = 0;//declare needed variables

  if(IsNumeric(textBox1.Text) == true)
  {
     // your convert code goes here
    yards = float.Parse(textBox1.Text); //convert string to number 

    feet = yards * 3;   // do the calculation
    
    textBox2.Text = feet.ToString(); //write the result to text Box2 
    //textBox2.Text = Convert.ToString(feet); //also works...
     
  }
  else
  {
     // your error message goes here
    textBox1.Text = "Need number"; //They didn't enter a number 
  }

*** Here is a complete example showing proper layout and comments.

*** unlike this example, you'll will need to use message boxes for validity checking.

Here is some formulus to help with your conversion:

fahr = (cent / (5 / 9)) + 32
cent = (fahr - 32) * 5 / 9

*** Remember, whenever you have a divide operation, one of the numbers must be a floating point number, as shown below...

fahr = (float) ((cent / (5 / 9.0)) + 32);


Please turn in your assignment by using the Assignment Turn-in at tinyRealm.com BBS.

*** If you don't already have an account, you'll need to register for the tinyRealm BBS.

Just post a "Reply" to the lab assignment message and upload your assignment (by "Attaching" a file to your reply message). You should attach your entire project zipped up in "zip" or "rar" format. *** If you don't have winzip or winrar, get them at tinyRealm.com They are available from the pull-down menu's (Useful downloads)(Archive...).

Naming convention: class_lab#_YourInitials.format

mine would look like: cisc2305_l1_efa.zip

Don't worry, it's easy, it's safe and you will be certain that you have turned in your work.

P.S. Any user can attach files to a post - however, in the turn-in area, only the instructor can download and read your attachment. Also, the system will automatically rename files that have the same name. *** If you don't like your post, you can delete it and it will delete all attachments.