GPA

PLEASE SOMEONE SHOULD HELP TO DEBUG THIS CODE NEED HELP!!!!

#include<iostream>
#include<iomanip>
#include<conio.h>
using namespace std;
float total_marks(float []);
int number,unit;
int tcu=25;
float gradePtTotal,Totalgrade,GPA;
string name,no_matric;



main()
{


float marks[500][1000]={0};

cout<<" C++ PROGRAM TO CALCULATE STUDENT GPA PRESENTED BY GROUP 27: "<<endl;
cout<<"________________________________________________________________________________ ";
cout<<"\n ENTER NUMBER OF STUDENT: ";

cin>>number;

for(int count_1=0;count_1<number;count_1++)
{
cout<<"\n Enter the marks obtained by student "<<count_1+1<<
" :"<<endl;
cout << "Student Name :"; //Enter student's name
cin>>name;
cout << "Student Matric Number : "; //Enter student's matric number
cin>>no_matric;
cout << "**********FIRST SEMESTER COURSES***** :"<<endl;
cout<<"Com313 Exam Score = ";
cin>>marks[count_1][0];


cout<<"\nMth313 Exam Score = ";
cin>>marks[count_1][1];

cout<<"\nCom316 Exam Score= ";
cin>>marks[count_1][2];


cout<<"\nCom312 Exam Score = ";
cin>>marks[count_1][3];


cout<<"\nSta311 Exam Score = ";
cin>>marks[count_1][4];

cout<<"\nGns301 Exam Score = ";
cin>>marks[count_1][5];

cout<<"\nCom311 Exam Score = ";
cin>>marks[count_1][6];


cout<<"\nCom314 Exam Score = ";
cin>>marks[count_1][7];


cout<<"\nSta314 Exam Score = ";
cin>>marks[count_1][8];


cout<<"\nGns312 Exam Score = ";
cin>>marks[count_1][9];

GPA=sum/tcu;




}

getch();

cout<<"\n ********************************* Result Sheet *****************************"<<endl;
cout<<"\nS\N COM313 MTH313 COM316 COM312";
cout<<" STA311 GNS301 COM311 COM314 STA314 ";
cout<<"GNS312 T.T GPA\n"<<endl;


for(int count_X=0;count_X<number;count_X++)
{


cout<<setw(0)<<count_X+1;
cout<<setw(5)<<marks[count_X][0];
cout<<setw(7)<<marks[count_X][1];
cout<<setw(7)<<marks[count_X][2];
cout<<setw(7)<<marks[count_X][3];
cout<<setw(7)<<marks[count_X][4];
cout<<setw(7)<<marks[count_X][5];
cout<<setw(7)<<marks[count_X][6];
cout<<setw(7)<<marks[count_X][7];
cout<<setw(7)<<marks[count_X][8];
cout<<setw(7)<<marks[count_X][9];
cout<<setw(7)<<total_marks(marks[count_X]);
cout<<setw(4)<<GPA;
cout<<endl;


}

cout<<"\n ******************************************************************************";

getch();
return 0;
}

/*************************************************************************/
//----------------------- total_marks(float []) -----------------------//
/*************************************************************************/

float total_marks(float marks[])
{
float sum=0;
float GPA=0;
for(int count=0;count<100;count++)
sum+=marks[count];







return sum;
}
Topic archived. No new replies allowed.