Hello to everyone! I have just started taking what is described as a beginning Visual Basic.Net class. I have no programming knowledge, except my class time which started mid January.
Right now I'm trying to figure out how to give a type of triangle(equilateral, scalene, or isosceles) and the shortest side of the triangle. We have been talking about relational, logical operators, If, Else statements.
I am thoroughly conflabbergasted at this point. Our text we are using, "Microsoft Visual Basic .Net Programming: problem analysis to design" , by E. Reed Doak, doesn't really seem to be beginner friendly. Am looking for suggestions on other text for BEGINNERS!
Here is the code I've managed in about3 hours work on this problem:
Module TriangleTypes
Sub Main()
:o
'
' Declare variables
Dim strTriangle As String
Dim intSide1, intSide2, intSide3 As Integer
'
' Ask for user Input
'
Console.Write("Enter length of side 1 of a triangle as an integer: ")
intSide1 = Convert.ToInt32(Console.ReadLine())
Console.WriteLine()
Console.Write("Enter length of side 2 of a triangle as an integer: ")
intSide2 = Convert.ToInt32(Console.ReadLine())
Console.WriteLine()
Console.Write("Enter length of side 3 of a triangle as an integer: ")
intSide3 = Convert.ToInt32(Console.ReadLine())
Console.WriteLine()
'
If intSide1 = intSide2 Then
strTriangle = "Equilateral"
Else
If intSide1 = intSide3 Then
strTriangle = "Equilateral"
Else
If intSide2 = intSide3 Then
strTriangle = "Equilateral"
Else
If intSide1 <> intSide2 Then
End If
End If
End If
Console.WriteLine("Your triangle type is: {0}", strTriangle)
ANY Help would be appreciated.
thanks,
jacjr (back to school at 40!)