Parag’s Den

Dedicated to my adored friends…..

10 – Assignments

Posted by paragdongre on June 4, 2008


You have learned many things throughout this tutorial. Now is the time for you to put your skills to the test. This chapter will give you a sample application and several problems to work on. The first problem has a sample application answer while the remaining problems are for you to solve yourself. Remember that there are several ways to solve a problem. Do not worry if your application is not the same as the sample application. As long as it works properly, you are good to go. Good luck!

Make a Calculator that converts Celsius to Fahrenheit and vice versa

Sample User Form is shown below

 

Sample Code is shown below

 

Public Class Form1

    Dim C As Single
    Dim F As Single

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        C = TextBox1.Text

        F = (9 / 5) * C + 32

        TextBox2.Text = F

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        F = TextBox1.Text

        C = (5 / 9) * (F – 32)

        TextBox2.Text = C

    End Sub

End Class

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: