-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcatAge_vb.vb
29 lines (24 loc) · 966 Bytes
/
catAge_vb.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Imports System
Module Program
Sub Main(args As String())
Dim in_age As Double
Dim out_age As Double
'Ask the user for their cat's age.
Console.Write("Enter the age of your cat: ")
in_age = Double.Parse(Console.ReadLine())
'Do the conversion based off the user's input
'and display the result to the screen.
If in_age >= 0.0 And in_age <= 1.0 Then
out_age = 16.6364 * in_age
Console.WriteLine($"Your cat is {out_age} years old.")
ElseIf in_age > 1.0 And in_age < 2.0 Then
out_age = 6.6364 * in_age + 10
Console.WriteLine($"Your cat is {out_age} years old.")
ElseIf in_age >= 2.0 Then
out_age = 4.1364 * (in_age + 3.62634)
Console.WriteLine($"Your cat is {out_age} years old.")
End If
'So the user can read the result from the calculations.
Console.ReadLine()
End Sub
End Module