here is my problem. i have to enter two grades, each grade should be an integer between 0 and 100 inclusive. Calculate the average of the two grades. If the average is greater than or equal to 90, display "Grade is an A!". It goes down the line for "if average is _______, display " ______is a/n __!" I get the last part and I know how to figure an average...but i am not sure how to type it in code. He did an elseif example, but it wasn't with 2 numbers and didn't have to average anything. So I don't know how to write that code....is there anywhere to look to find it? Here is what I have so far.............
Module Module1
Sub Main()
Dim grade, sum, average As Double
Dim numberofgrades As Integer = 2
Console.WriteLine("Please enter a grade")
grade = Convert.ToDouble(Console.ReadLine())
sum += grade
Console.WriteLine("Please enter a grade")
grade = Convert.ToDouble(Console.ReadLine())
sum += grade
average = sum / numberofgrades
If average >= 90 Then
Console.WriteLine("Grade is an A!")
ElseIf average >= 80 And <90 then
Console.WriteLine("Grade is an B!")
End If
End Sub
End Module
I fiddled around till I got the dim, grade, sum, average as double and so forth. BUT am still very confused at how I would know how to write these programs. Am working out of visual basic.net programming from problem alalysis to program design. (Doke and Williams)

New Topic/Question
Reply




MultiQuote






|