create a program that includes two functions named calcavg() and ariance(). The calcavg() function should calculate and return the average of the values stored in an array named testvals. The array should be declared in main() and include the values 89,95,72,83,99,54,86,75,92,73,79,75,82,73. the variance() function should calculate and return the variance of the data. the variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg and variance should be displayed using cout statements in main()

this is my assignment.. and i really don't know what to do..
thanks a lot.. it will be greatly appreciated..
i hope someone can help me..

more power and god bless...

Recommended Answers

All 5 Replies


did you really think "pls?..." was gona change the forum rules/attitude?

You can do it by your own......... try a little bit.


>i really don't know what to do..
What don't you know how to do? All the information is right there, just do one step at a time and i'm sure you can manage it. When you get stuck on a specific problem, we will help. But don't expect anybody to do it for you.

>includes two functions named calcavg() and variance()

float calcavg() {
  // Code Here

float variance() {
  // Code Here

int main() {
  // Code Here


Getting the picture?

commented: *agrees* +25
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.