Z zMiiGHTz Distinguished Sep 5, 2011 1 0 18,510 Sep 5, 2011 #1 i need to adapt this program to find the volume of a cube Dim Radius As Integer = 5 Dim Area As Double Const Pi As Double = 3.14159265 Area = Pi * (Radius^2) MsgBox(Area)
i need to adapt this program to find the volume of a cube Dim Radius As Integer = 5 Dim Area As Double Const Pi As Double = 3.14159265 Area = Pi * (Radius^2) MsgBox(Area)
PhilFrisbie Distinguished Apr 22, 2006 666 1 19,310 Sep 6, 2011 #2 That is a trivial task for a homework assignment! Just remove the code you don't need for a cube, and add the code you do need.
That is a trivial task for a homework assignment! Just remove the code you don't need for a cube, and add the code you do need.
hang-the-9 Titan Mar 25, 2010 20,151 284 124,800 Sep 7, 2011 #3 volume of cube: even easier to find than the other code. If a circle has radius, a box has what in relation? Then put that to the 3rd power. I sure hope you are not going into engineering and we have to drive over bridges you designed.
volume of cube: even easier to find than the other code. If a circle has radius, a box has what in relation? Then put that to the 3rd power. I sure hope you are not going into engineering and we have to drive over bridges you designed.
Hawkeye22 Distinguished Moderator Feb 10, 2006 713 0 19,460 Sep 7, 2011 #4 ...and the formula is even eaiser. For a perfect cube, volume = (length of any side)^3.
PhilFrisbie Distinguished Apr 22, 2006 666 1 19,310 Sep 7, 2011 #5 ^^ I assumed he at least knew that