473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Could use some help... How would I sum an array... and yes i am a noob ^^

I need to sum an array.

Private Function calculateAverage(ByVal averageIncomeDecimal) As Decimal
Dim totalIncomeDecimal As Decimal = 0
Dim totalLoopInteger As Integer = 0
For totalLoopInteger = 0 To famIncomeCountInteger
totalIncomeDecimal += familyIncomeDecimal(100)
totalLoopInteger += 1
Next totalLoopInteger

averageIncomeDecimal = totalIncomeDecimal / totalLoopInteger

So this is what I have...
Nov 15 '07 #1
1 965
QVeen72
1,445 Expert 1GB
Hi,

Change it to :

Expand|Select|Wrap|Line Numbers
  1. Dim totalIncomeDecimal As Decimal = 0
  2. Dim i As Integer = 0
  3.  
  4. For i = 0 To famIncomeCountInteger
  5.   totalIncomeDecimal =  totalIncomeDecimal + familyIncomeDecimal(i)
  6. Next i
  7.  
  8. MsgBox totalLoopInteger 
  9.  
  10.  
Regards
Veena
Nov 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

62
by: vubaboota | last post by:
I HAVE SOME SERIOUS PROBLEM , HOW TO MAKE A PROGRAM IN C Q1: Write a program using malloc function. In which you take input from user and allocate memory equal to square of this number. Which...
6
by: Paulchen | last post by:
Hello, I have found a perl script and need to "translate" this to PHP. I try to do it step by step and the first part of it is this function (the whole script is found at...
5
by: enkidu72 | last post by:
Hello everybody , I have a problem with arrays ... I need to get some data from files in some directories . The names of the dirs are something like 12.12344 or 23.34441. Some contains one ,...
1
by: Tsun | last post by:
Hello all. First of all I am new to Perl, but not the fine art of programming, and I must say that Perl is one funky language. Anyway. I have a scope issue with the code I have been asked to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.