#define size 10
#include<iostream.h>
#include<conio.h>
void main()
{
void line(void);
char g[size],name[size][45],course[size][5],sem[size][10],ses[size][10],sub[size][5][20];
int roll[size],i=0,j=0;
float m[size][5],t[size],p[size],sum=0;
cout<<"Enter details:\n";
while(i!=size)
{
cout<<"Student "<<i+1<<":\nName:";
cin>>name[i];
cout<<"Roll:";
cin>>roll[i];
cout<<"Enter course:";
cin>>course[i];
cout<<"Enter semester:";
cin>>sem[i];
cout<<"Enter session:";
cin>>ses[i];
while(j!=5)
{
cout<<"Enter subject "<<j+1<<':';
cin>>sub[i][j];
cout<<"Enter marks obtained in "<<sub[i][j]<<':';
cin>>m[i][j];
sum=sum+m[i][j];
j++;
}
t[i]=sum;
p[i]=t[i]/5;
if(p[i]>=75)
g[i]='A';
else if(p[i]>=60)
g[i]='B';
else if(p[i]>=50)
g[i]='C';
else
g[i]='F';
i++;
j=0;
sum=0;
clrscr();
}
i=0;
cout<<"\n\tMarks Details\n***********************************\n";
while(i!=size)
{
cout<<"|Course: "<<course[i]<<"\tSemester: "<<sem[i];
cout<<" |\n|Roll: "<<roll[i]<<"\tSession: "<<ses[i];
cout<<"|\n|Name: "<<name[i]<<endl<<"|Subjects:\n";
line();
cout<<endl;
for(j=0;j<5;j++)
cout<<'|'<<sub[i][j]<<"|\t";
cout<<endl;
line();
cout<<endl;
for(j=0;j<5;j++)
cout<<'|'<<m[i][j]<<"|\t";
cout<<endl;
line();
cout<<"\n|Total: "<<t[i]<<"\t|Percentage: "<<p[i];
cout<<"\n\t Grade: "<<g[i]<<endl;
i++;
line();
}
getch();
clrscr();
}
void line (void)
{
int i=0;
while(i!=38)
{
cout<<'-';
i++;
}
}
#include<iostream.h>
#include<conio.h>
void main()
{
void line(void);
char g[size],name[size][45],course[size][5],sem[size][10],ses[size][10],sub[size][5][20];
int roll[size],i=0,j=0;
float m[size][5],t[size],p[size],sum=0;
cout<<"Enter details:\n";
while(i!=size)
{
cout<<"Student "<<i+1<<":\nName:";
cin>>name[i];
cout<<"Roll:";
cin>>roll[i];
cout<<"Enter course:";
cin>>course[i];
cout<<"Enter semester:";
cin>>sem[i];
cout<<"Enter session:";
cin>>ses[i];
while(j!=5)
{
cout<<"Enter subject "<<j+1<<':';
cin>>sub[i][j];
cout<<"Enter marks obtained in "<<sub[i][j]<<':';
cin>>m[i][j];
sum=sum+m[i][j];
j++;
}
t[i]=sum;
p[i]=t[i]/5;
if(p[i]>=75)
g[i]='A';
else if(p[i]>=60)
g[i]='B';
else if(p[i]>=50)
g[i]='C';
else
g[i]='F';
i++;
j=0;
sum=0;
clrscr();
}
i=0;
cout<<"\n\tMarks Details\n***********************************\n";
while(i!=size)
{
cout<<"|Course: "<<course[i]<<"\tSemester: "<<sem[i];
cout<<" |\n|Roll: "<<roll[i]<<"\tSession: "<<ses[i];
cout<<"|\n|Name: "<<name[i]<<endl<<"|Subjects:\n";
line();
cout<<endl;
for(j=0;j<5;j++)
cout<<'|'<<sub[i][j]<<"|\t";
cout<<endl;
line();
cout<<endl;
for(j=0;j<5;j++)
cout<<'|'<<m[i][j]<<"|\t";
cout<<endl;
line();
cout<<"\n|Total: "<<t[i]<<"\t|Percentage: "<<p[i];
cout<<"\n\t Grade: "<<g[i]<<endl;
i++;
line();
}
getch();
clrscr();
}
void line (void)
{
int i=0;
while(i!=38)
{
cout<<'-';
i++;
}
}
No comments:
Post a Comment