السلام عليكم ورحمة الله تعالى وبركاته، أقدم لكم هذا البرنامج الذي يقوم بحساب معدل شهادة البكالوريا لشعبة علوم تجريبية، بإمكانكم تعديل معاملات المواد كما ترغبون.
كود البرنامج :
كود:
#include <stdio.h>
int main()
{
float science, phy, math, ar, fr, en, philo, hisgeo, islamic, sport,somme,moy;
printf("\n\n\tEntrer votre notes ( Science/Physique/Math/Ar/Fr/En/Philo/HisGeo/Islamic/Sport ) : ");
scanf("%f/%f/%f/%f/%f/%f/%f/%f/%f/%f",&science,&phy,&math,&ar,&fr,&en,&philo,&hisgeo,&islamic,&sport);
printf("\n\n");
printf("\t\t---------------------------------\n");
printf("\t\t| Releve de notes |\n");
printf("\t\t---------------------------------\n");
printf("\n");
printf("\t---------------------------------------------------------\n");
printf("\t| Matiere\tNote\t\tCoefficient\tSomme\t|\n");
printf("\t---------------------------------------------------------\n");
printf("\t| Science\t%.2f\t\t6\t\t%.2f\t|\n",science,science*6);science = science * 6;
printf("\t| Physique\t%.2f\t\t5\t\t%.2f\t|\n", phy, phy * 5);phy = phy * 5;
printf("\t| Mathematique\t%.2f\t\t5\t\t%.2f\t|\n", math, math * 5);math = math * 5;
printf("\t| Arabic\t%.2f\t\t3\t\t%.2f\t|\n", ar, ar * 3);ar = ar * 3;
printf("\t| Francais\t%.2f\t\t2\t\t%.2f\t|\n", fr, fr * 2);fr = fr * 2;
printf("\t| Anglais\t%.2f\t\t2\t\t%.2f\t|\n", en, en * 2);en = en * 2;
printf("\t| Philosophie\t%.2f\t\t2\t\t%.2f\t|\n", philo, philo * 2);philo = philo * 2;
printf("\t| His/Geo\t%.2f\t\t2\t\t%.2f\t|\n", hisgeo, hisgeo * 2);hisgeo = hisgeo * 2;
printf("\t| Islamic\t%.2f\t\t2\t\t%.2f\t|\n", islamic, islamic * 2);islamic = islamic * 2;
printf("\t| Sport\t\t%.2f\t\t2\t\t%.2f\t|\n", sport, sport * 2);sport = sport * 1;
printf("\t---------------------------------------------------------\n");somme = science + phy + math + ar + fr + en + philo + hisgeo + islamic + sport;
printf("\t|\tSomme\t\t|\t30\t\t%.2f\t|\n", somme);moy = somme / 30;
printf("\t---------------------------------------------------------\n");
printf("\t\t\t\t\t|\tMoyenne : %.2f\t|\n",moy);
printf("\t\t\t\t\t-------------------------\n");
printf("\n");
}