Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Need help with Visual Basic 2010 homework
New Posts  All Forums:Forum Nav:

Need help with Visual Basic 2010 homework

post #1 of 2
Thread Starter 
I have to create an application that converts a Celsius temperature, C, to its equivalent Fahrenheit temperature,F. using this formula ..F=9/5C+32. The instructor quizzed thru the chapter and 95% all ready has programming experience. I tried to code it but I am so lost... =( I don't know what I am doing wrong.

Public Class TemperatureConverter
'Convert Celsius temperature to its equivalent Fahrenheit temperature.

Private Sub convertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertButton.Click

Dim c As Integer 'first number entered by the user
Dim f As Integer 'sum of integer

c = cTextBox.Text 'get the first number entered
f = (9 \ 5) c + 32
End Sub 'convertButton_Click
End Class 'TemperatureConverter
post #2 of 2
Off the top of my head.
Code:
Dim Temp As Double
Dim Result as Double
Convert.ToString(txtTemp)
F = (1.8 * C) + 32
lblResult.Text = Format(dblResult, ".")

You could go one step ahead and use radio buttons and have the option to convert both ways.
Red Fireball
(13 items)
 
Asus G55
(6 items)
 
 
CPUMotherboardGraphicsRAM
E8400 ASUS Maximus Formula HD4890 2GB (2x1GB) OCZ Titanium PC2-6400 
Hard DriveOptical DriveOSMonitor
2TB(7200.12)+ 2 x 1TB(7200.12) LG Windows 7 Ultimate 64-Bit Dell E228WFP 22" LCD 
KeyboardPowerCaseMouse
Logitech G-15 Corsair 650TX Lian Li V2000 Painted Black Logitech G9x 
Mouse Pad
fUNC Industries Surface 1030 
CPUGraphicsHard DriveHard Drive
i7 3630QM Nvidia GTX660M 128GB Samsung 840 Pro 500GB Hitachi 
OSMonitor
Windows 8 1080P Matte  
  hide details  
Reply
Red Fireball
(13 items)
 
Asus G55
(6 items)
 
 
CPUMotherboardGraphicsRAM
E8400 ASUS Maximus Formula HD4890 2GB (2x1GB) OCZ Titanium PC2-6400 
Hard DriveOptical DriveOSMonitor
2TB(7200.12)+ 2 x 1TB(7200.12) LG Windows 7 Ultimate 64-Bit Dell E228WFP 22" LCD 
KeyboardPowerCaseMouse
Logitech G-15 Corsair 650TX Lian Li V2000 Painted Black Logitech G9x 
Mouse Pad
fUNC Industries Surface 1030 
CPUGraphicsHard DriveHard Drive
i7 3630QM Nvidia GTX660M 128GB Samsung 840 Pro 500GB Hitachi 
OSMonitor
Windows 8 1080P Matte  
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Need help with Visual Basic 2010 homework