Question how to display properties; cross-sectional area, sectional modulus, inertia

kaye

New member
Joined
Aug 10, 2011
Messages
4
Programming Experience
Beginner
Hi! I am a VB.Net newbie and I'm a little lost with my codes. pls help me correct it. thank you :uncomfortableness:

here's my problem:

VB.jpg.jpg





and here's the code i made: (the bold part seems to be the problem)

Module Module1






Sub Main()
Dim height As Integer
Dim base As Integer
Dim crosssection As Integer
Dim inertia As Integer
Dim section As Integer






Console.WriteLine("Enter base number:")
base = Val(Console.ReadLine())


Console.WriteLine("enter height number:")
height = Val(Console.ReadLine())




Console.Write("Lumber")
Console.Write(" crossection")
Console.Write(" inertia")
Console.WriteLine(" section")






Console.Write(base & "*" & height & " ")







crosssection = base * height
Console.Write(" ")


Console.Write(Math.Round(crosssection, 2))






inertia = base * (height ^ 3) / 12
Console.Write(" ")
Console.Write(Math.Round(crosssection, 2))






section = base * (height ^ 2) / 6
Console.Write(" ")
Console.Write(Math.Round(crosssection, 2))


'console.read()
Console.ReadLine()












End Sub


End Module
 
Last edited:
Help us to help you... what is the problem you're getting? Error messages, unexpected behaviour, etc.
 
the problem is that the first formula seemed to be the only one working. the other formulas are not working. can you help me fix that?
 
What input values are you testing with?

What is the expected output for your test data?

What is the actual output of your test data?

I suspect you need to add some brackets to get around operator precedence - the answers to the above should show whether that's the case.
 
just click the VB.jpg.jpg and you'll see the problem and the result.


thanks. I'm going to try the brackets.
 
All the JPG shows are the formula, it doesn't show any test data and what you expect the test data to produce.
 
Back
Top