dell123 0 Report post Posted January 3, 2005 aku tak tau sangat c++ tapi aku kena buat..kena gak memaksakan diri buat...tapi aku tak tahu....aduuii..kalau vb tue boley la...nie projek dia kasi sekali dua vb than c++...arrrgghh mana satu nak ingat...jadi aku memerlukan member2 yang expert c++ tue kalau boley tolong lah aku kasi contoh pun jadi lah untuk buat program c++ nie nak selesaikan soalan nie..write a program that allows the user to enter the students name...output:- ->class average ->names of all students whose test scores are below the class average ->highest test score and the name of at studts having the highest score Quote Share this post Link to post Share on other sites
encik pot pet 0 Report post Posted January 5, 2005 ok... malas nak cakap banyakhttp://www.google.com.my/search?q=c%2B%2B+...:en-US:officialhttp://mathbits.com/MathBits/CompSci/Structures/Sorting.htm Quote Share this post Link to post Share on other sites
otai_g 3 Report post Posted July 14, 2008 nak contribute sikit//otai_g[c] properties #include <iostream> #include <string> #define MAX 3 //setkan student kepada 3 org utk memudahkan aku using namespace std; void main () { string name[MAX]; int i, index=0; double score[MAX], average, totalScore=0, highest; for (i=0; i<MAX; i++) { cout<<"Name : "; cin>>name[i]; cout<<"Score : "; cin>>score[i]; totalScore = totalScore + score[i]; } average = totalScore / MAX; cout<<"\nClass average : "<<average<<endl; cout<<"\nStudents below the class average"<<endl; cout<<"================================"<<endl; for (i=0; i<MAX; i++) { if (score[i] < average) cout<<name[i]<<" with score "<<score[i]<<endl; } cout<<"\nStudents the highest score"<<endl; cout<<"=========================="<<endl; highest = score[0]; for (i=1; i<MAX; i++) { if (highest < score[i]) { highest = score[i]; index = i; } } cout<<name[index]<<" with score "<<score[index]<<endl; } Quote Share this post Link to post Share on other sites