Conversion Learn programming with Visual Basic (VB.net) exercises

Lesson:

First contact with Visual Basic (VB.net)


Exercise:

Conversion 91


Objetive:

Create a Visual Basic (VB.net) program to convert from Celsius degrees to Kelvin and Fahrenheit: it will ask the user for the amount of Celsius degrees and using the following conversion tables:

Kelvin = Celsius + 273
Fahrenheit = Celsius x 18 / 10 + 32


Code:

Imports System
Public Class exercise14
    Private Shared Sub Main()
        Console.Write("Enter the amount of celsius: ")
        Dim celsius As Integer = Convert.ToInt32(Console.ReadLine())
        Console.WriteLine("Kelvin = {0}", celsius + 273)
        Console.WriteLine("Fahrenheit = {0}", celsius * 18 / 10 + 32)
    End Sub
End Class