Question about Microsoft Computers & Internet

# How to compute a class average using arrays - Microsoft Computers & Internet

Posted by on

• Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that gotĀ 5 achievements.

Sergeant:

An expert that hasĀ over 500 points.

Champion:

An expert who has answered 200 questions.

• Expert

Hi, here is the program #include<stdio.h> #include<conio.h> void main() { int class[30],i; float sum=0,avg=0; printf("enter marks"); for(i-0;i<30;i++) scanf("%d",&class[i]); for(i-0;i<30;i++)
sum+=class[i]; avg=sum/30; printf("%f",avg); getch(); }

Posted on May 08, 2009

## 1 Suggested Answer

Hi there,
Save hours of searching online or wasting money on unnecessary repairs by talking to a 6YA Expert who can help you resolve this issue over the phone in a minute or two.

Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.

Here's a link to this great service

Good luck!

Posted on Jan 02, 2017

×

my-video-file.mp4

Complete. Click "Add" to insert your video.

×

## Related Questions:

### Write a program c that declares an array of 100 elements to hold these values. Read the values in from the file and store them in successive elements of the array. Keep track of how many numbers are read...

That appears to be an intermediate question in a programming class. Best read the book, the answer is not what is important the process of getting the answer is what you are trying to learn.

May 17, 2017 | Office Equipment & Supplies

### The following frequency distribution analyzes the scores on a math test. find the indicated class midpoint or boundaries. 40-55 2 60-75 4 76-82 6 83-94 15 95-99 5

Midpoints ( x + y)/2 = x47.567.57988.597

Boundaries for lower class -0.5 and +.0.5 for upper.39.5 - 55.559.5 - 75.575.5 - 82.582.5 - 94.594.5 - 99.5
I just don't get how the number of students factor in? It's still an average.

Oct 11, 2012 | Computers & Internet

### This is an illustration of use of classes in php please tell me do i need to put the classes in seperate php file and the objects in seperate file or in other words for the below example how many seperate...

Everything can be in the one file if you want, but that doesn't help with segregation of logic from the presentation layer (i.e. what you see on screen).

Personally I'd put my core class libraries in one or more files and include() them. And I'd probably put any extended classes in separate files and include() them additionally.

include ('library.class.php');
include ('extended.class.php');

Oct 14, 2009 | Computers & Internet

### I am java beginner and I want a help in writing a java program to calculate the variance for an array of numbers

the best thing to do here is to separate the steps for calculating the variance into different functions. To compute the variance the first thing to do is to compute the mean or the average of the numbers in the array. so your first function will loop through each of the numbers and divide it by the length of your array. the output is the returned. The next thing to do is create another function for the variance. loop through each of the numbers again and subtract to each number the mean. square the value then add to the previous. so that means you have another variable that starts from zero and just adds the answer. after that divide it by the length of the array again and what you are going to get is the value for the variance.

May 13, 2009 | Computers & Internet

### A Program using an array that culculates the sum and average of the five input values?

Hi,
I am writing in C code here
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],i,sum=0;
float avg=0;
printf("enter the five values");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
for(i=0;i<5;i++)
sum+=a[i];
printf("Sum=%d",sum);
avg=sum/5;
printf("Average=%f",avg);
getch();
}

Mar 18, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

### To merge two arrays A and B in java source code.

Do you need them to be sorted after the merge and are they already sorted? If not, then what you can do is create a temporary third array which will set the half of third array equal to the first array, and then set the set half equal to the second array. If they need to be sorted, I can help too but you need to tell me

public class ArrayMerge
{
public static int arr1[] = new int [20];
public static int arr2[] = new int [20];

public static void main()
{
setScores(arr1);
setScores(arr2);
printScores(arr1);
printScores(arr2);
printScores(merger(arr1,arr2));
}

public static void setScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
a[x]= (int)(Math.random() * 100)+1;
}
}

public static void printScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
System.out.print(a[x] + " ");
}
System.out.println();
}

public static int[] merger(int a1[], int a2[])
{
int a3[] = new int [(a1.length + a2.length)];

for(int x = 0; x<a1.length; x++)
{
a3[x]=a1[x];
}

for(int x = 0; x<a2.length; x++)
{
a3[x+a2.length]=a2[x];
}
return a3;
}
}

Jan 24, 2009 | Microsoft Windows XP Professional With...

### Excel will not displaying the results of a trend array formula

Hi Griffnz,

Your "known Y's" or 'values' are in Column B. This is the first array in the Trend formula.

Your "known X's" or 'months' are in Column A. This is the second array in the trend formula.

The trend formula is supposed to give you a projection of what the rest of the values in Column B will be over the next few months (usually continuing cells in Column A). The cells you want these values to show up in represent the third array in the formula.

Thus, your formula should look more like: '=trend(B3:B14,A3:A14,A15:A18)'

However, your formula is leaving out The values in B and adding values from C - -- but there ARE no values in C. Apparently, C is where you want the values to appear. In that case, the C array would be the third array in your formula. This would look more like '=trend(B3:B14,A3:A14,C3:C14)

If this doesn't make sense, let me know.

Sep 30, 2008 | Microsoft Excel for PC

## Open Questions:

#### Related Topics:

117 people viewed this question

## Ask a Question

Usually answered in minutes!

Level 3 Expert

Level 3 Expert