Jump to content
dahlea

Help Me......!desperate Sgt Ni...puhlish..

Recommended Posts

assalamualaikum....can anybody in here help me solving my dunno-wut-todo prob....

act im still new in this c kind of thing..tak expert langsung...n yet i hav to submit my assignment in 1 weeks from now(i guess).all the codes dah ade.but byk error n i dunno how to fix it :( ..ye la kan...im just like setahun jagung in dealing with this thingy.so,i hope sumbody can gimme a hand n correcting my codes :D

this is the question...

write a program that accepts a list f about 100 scores and process the scores as follows:

a. find the highest,lowest and average of scores

b. find the mode,standard deviation and median of the scores

c. Display the histogram for the distribution of scores

this is how i put all the codes together yang sah2 mmg salah :blush:

for highest:

int highest;

int temp;

int SIZE[100];

int temp SIZE[0];/* 0 is the first number in the list

int i;

for (i=0;i<+100;++i)

{

if (temp>SIZE[i+1])

temp=SIZE[i+1];

}

highest=temp;

for lowest:

int lowest;

int SIZE[100];

int temp;

int temp SIZE[0];

int i;

for (i=0;i<=100;++i)

{

if (temp<SIZE[i+1])

temp=SIZE[i+1];

}

lowest=temp;

for average;

float average;

int total=0;

for (0;;i++)

{

total=total+SIZE;

}

average=total/100;

}

for mode:

int rating;

int j;

int h;

int largest=0;

int modevalue=0;

for (rating=1;rating<=9;rating++)

{

freq[rating]=0;

}

for (j=0;j<SIZE;j++)

{

++freq[answer[j]];

}

for(rating=1;rating<=9;rating++)

{

printf ("%8d %11d",rating,freq[rating]);

}

if (freq[rating>largest)

{

largest=freq[rating];

modevalue=rating;

}

im not sure bout standard deviation n median but this is the formula for standard deviation:

sqrt(sum_sqrt/highest_score-average*average;

for histogram:

int answer,rating;

int frequency={0};

int responses=FILE*thefile;

for (answer=0;answer<SIZE;answer++)

{

++frequency[responses[answer]];

}

printf (%s%17s\n","Rating","Frequency");

for (rating=1;rating<SIZE;rating++)

{

printf ("%6d%17d\n",rating,frequency[rating]);

}

thats all yang termampu saye buat.hope sangat anybody boleh tolong saye.hidup n mati pnye case ni...an if possible,response asap la ek..cuz dateline is just around the corner..since bulan ramadahn ni,tlg la sedekahkan ilmu kat saye yang tak seberape nak ade ilmu ni ek..hehe..THANKS ALOT!!!ur concern is really appreciated.

Edited by dahlea

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...