Smart Lab Helping Forum

Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: net prblem


Newbie

Status: Offline
Posts: 2
Date:
net prblem
Permalink  
 


Sir due to bad signal of wateen my file was not uploaded at lms and time goes up so i am sending you here and i have e-mailed you also.
Tariq Rehman
Sec A
Reg no. 186

 

#include <stdio.h>
#define size 7
int i;
int marks[7];
void GPAsystem(char gpa[7]);
int GPAcalculation(float gpacal[7]);
int main()
{int trecrdtsub='3';
int tocrdtsub='2';
float totalGPA='0';
float finalGPA;
char GPA[7]={'A','B','b','C','c','D','F'};
float GPAcal[7]={'4.0','3.5','3.0','2.5','2.0','1.5','1.0'};
char subject[]="  3crdtsub1, 3crdtsub2, 3crdtsub3, 3crdtsub4, 2crdtsub1, 2crdtsub2, 2crdtsub3";
printf("%s\nInput numbers according to above sequence\n", subject);
for(i=0;i<7;i++)
{ scanf("%d", &marks);
}
printf("\n%s\n", subject);
for(i=0;i<7;i++)
{printf("%10d" ,marks);
}
printf("\n");
GPAsystem(GPA);
for(i=0;i<7;i++){
    printf("%10c", GPA[7]);}
GPAcalculation(GPAcal);
for(i=0;i<4;i++)
{GPAcal= trecrdtsub*GPAcal;}
for(i=4;i<7;i++)
{GPAcal= tocrdtsub*GPAcal;}
for(i=0;i<7;i++)
{printf("%10f", GPAcal);}
for(i=0;i<7;i++)
{totalGPA=totalGPA+GPAcal;}
for(i=0;i<7;i++)
{finalGPA=(totalGPA/18);}
printf("total credit points=%40f", totalGPA);
printf("final GPA=%40f", finalGPA);

}
void GPAsystem(char gpa[7])
{
for(i=0;i<7;i++)
{if (marks>90)
{marks=gpa[0];}
else if (80<marks<90)
{marks=gpa[1];}
else if (70<marks<80)
{marks=gpa[2];}
else if (60<marks<70)
{marks=gpa[3];}
else if (50<marks<60)
{marks=gpa[4];}
else if (40<marks<50)
{marks=gpa[5];}
else if (marks<40)
{marks=gpa[6];}
}
}
int GPAcalculation(float gpacal[7])
{for(i=0;i<7;i++)
{if (marks>90)
{marks=gpacal[0];}
else if (80<marks<90)
{marks=gpacal[1];}
else if (70<marks<80)
{marks=gpacal[2];}
else if (60<marks<70)
{marks=gpacal[3];}
else if (50<marks<60)
{marks=gpacal[4];}
else if (40<marks<50)
{marks=gpacal[5];}
else if (marks<40)
{marks=gpacal[6];}
}
return gpacal[7];
}



__________________


Veteran Member

Status: Offline
Posts: 39
Date:
Permalink  
 

Next time please submit on LMS 2 hrs before the deadline. And do not share your code on the forum please, this is an individual assignment. Once the assignment deadline is over, you may do that.

Shamyl

__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.



Create your own FREE Forum
Report Abuse
Powered by ActiveBoard