|
-
Jan 9th, 2009, 12:15 PM
#1
Thread Starter
New Member
VB 6 Help calculating second moment of area!!
I am required to write the code fragment to calculate the second moment of area for 5 hollow circular sections assuming that the diameter and thickness for the 5 sections are stored in the text file results.dat. The text file contains 5 lines, one per Circular Hollow Section and the data is stored as diameter,thickness. I am required to read this file and stor the diamters in one-dimensional array called d and the associated thickness are to be stored in a one-dimensional array called t. I have to calculate the second moment of area for all 5 sections using the formula pi*d^4/64 and output results.
Any ideas/suggestions on how i should begin to do this?? i am very new to visual basic and would appreciate some help
-
Jan 10th, 2009, 02:04 AM
#2
Re: VB 6 Help calculating second moment of area!!
policy here, i believe, is we do not do your homework, we will help with code if some of it does not work correctly
there are many examples on reading text files, search for open for input
check out split, to divide up a string read from a file
then do the math with your formula, looping through the arrays and display output to some control
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|