السلام عليكم ورحمة الله وبركاته
الرجاء مساعدتي في معرفة ماهو الخطأ في هذا البرنامج
طبعاً الـ compiler يقول انه يوجد ثلاثة اخطأ وفي الأسطر كذا وكذا وكذا
لكن المشكلة لا اعرف اين يكمن الخطأ بالتحديد
ثم كيف تتم معالجته
(الرجاء التأكد من جميع الـ functions وإستدعاءتها التي هي على شكل مصفوفة array)
وشكرا لكم مقدماً
using namespace std;
void PrintGrade (float []); // first function
void PrintAcademicStatus (float [], int [], int []); // second function
void PrintWarning (float []); // therd function
void main ()
{
int hours_achieved[10], level[10];
long int ID_number[10];
float GPA[10], score[10], academic_status[10];
char name[10][80];
for (int number_of_students=1; number_of_students<=10; number_of_students++)
{
if (number_of_students>=2)
cout << "\nnext student\n";
else;
cout << "enter the name? \n";
cin >> name[number_of_students];
cout << "enter the ID number? \n";
cin >> ID_number[number_of_students];
cout << "enter the GPA? \n";
cin >> GPA[number_of_students];
cout << "enter the hours achieved? \n";
cin >> hours_achieved[number_of_students];
cout << "enter the level? \n";
cin >> level[number_of_students];
cout << "enter the score of programming? \n";
cin >> score[number_of_students];
cout << "this student No. " << number_of_students << " of 10 students";
PrintGrade (score);
PrintAcademicStatus (academic_status, hours_achieved, level);
PrintWarning (GPA);
} //end of the main function
// start of other functions
void PrintGrade (float score2[]) // first function
{
for (int number_of_students=1; number_of_students<=10; number_of_students++)
{
if ((score2[number_of_students]>=90)&&(score2[number_of_students]<=100))
{ if (score2[number_of_students]>=95)
cout << "\nhe got " << 'A' << "+";
else if (score2[number_of_students]<95)
cout << "\nhe got " << 'A';
}
else if ((score2[number_of_students]>=80)&&(score2[number_of_students]<90))
{ if (score2[number_of_students]>=85)
cout << "\nhe got " << 'B' << "+";
else if (score2[number_of_students]<85)
cout << "\nhe got " << 'B';
}
else if ((score2[number_of_students]>=70)&&(score2[number_of_students]<80))
{ if (score2[number_of_students]>=75)
cout << "\nhe got " << 'C' << "+";
else if (score2[number_of_students]<75)
cout << "\nhe got " << 'C';
}
else if ((score2[number_of_students]>=60)&&(score2[number_of_students]<70))
{ if (score2[number_of_students]>=65)
cout << "\nhe got " << 'D' << "+";
else if (score2[number_of_students]<65)
cout << "\nhe got " << 'D';
}
else if ((score2[number_of_students]<60)&&(score2[number_of_students]>=0))
cout << "\nhe got " << 'F';
else if (score2[number_of_students]<0)
cout << "\nplease enter positive score after restart the program";
else
cout << "\nplease enter the score from 0 to 100 after restart the program";
}
}
void PrintAcademicStatus (float academic_status2[],int hours_achieved2[], int level2[]) // second function
{
for (int number_of_students=1; number_of_students<=10; number_of_students++)
{
academic_status2[number_of_students] = (hours_achieved2[number_of_students] / level2[number_of_students]); // mathematical expression
if (academic_status2[number_of_students]>=16) // the 16 is the average number of hours achieved in level
cout << "\nacademic status: a regular student";
else if (academic_status2[number_of_students]<16)
cout << "\nacademic status: a unregular student";
else
cout << "\nenter your hours achieved and your level correctly";
}
}
void PrintWarning (float GPA2[]) // therd function
{
for (int number_of_students=1; number_of_students<=10; number_of_students++)
{
if ((GPA2[number_of_students]<=4)&&(GPA2[number_of_students]>=1))
cout << "\nhe don't have any academic warning \n";
else if ((GPA2[number_of_students]<1)&&(GPA2[number_of_students]>=0))
cout << "\nhe have one or more of academic warnings \n";
}
}
# include <iostream>
