يه برنامه c ++ !
اطلاعات عمومی دانشجوخصوصیات برنامه:
1)وارد کردن نمره به تعداد دلخواه
2)بازه نمرات بین 0 تا 100
3)مشخص کردن وضعیت نمرات
4)گرفتن میانگین
5)مشخص کردن تعداد افراد قبول و مردود شده
#include <iostream.h>
#include <conio.h>
int main()
{
float x, counter=1, counterp=0, counterf=0,ave=0,y,m;
cout<<"How many mark? ";
cin>>y;
cout<<"Pass and Fail: ";
cin>>m;
cout<<"#########################################";
cout<<"\n";
while (counter<=y){
cout<<"Mark "<<counter<<": ";
cin>>x ;
counter=counter+1;
ave+=x;
if (x>100){
cout<<"ERROR:FALSE MARK"<<"\n";
cout<<"\n";
cout<<"egain enter the ";
counter=counter-1;
}
else if (x>=m){
cout<<"Pass"<<"\n"<<"*********************"<<"\n"<<"\n";
counterp+=1;
}
else{
cout<<"Fail"<<"\n"<<"*********************"<<"\n"<<"\n";
counterf+=1;
}
}
if (counter=y){
cout<<"Pass number: "<<counterp<<"\n";
cout<<"Fail number: "<<counterf<<"\n";
cout<<"Average: "<<ave/y<<endl;
}
getch();
return 0;
}
#include <conio.h>
int main()
{
float x, counter=1, counterp=0, counterf=0,ave=0,y,m;
cout<<"How many mark? ";
cin>>y;
cout<<"Pass and Fail: ";
cin>>m;
cout<<"#########################################";
cout<<"\n";
while (counter<=y){
cout<<"Mark "<<counter<<": ";
cin>>x ;
counter=counter+1;
ave+=x;
if (x>100){
cout<<"ERROR:FALSE MARK"<<"\n";
cout<<"\n";
cout<<"egain enter the ";
counter=counter-1;
}
else if (x>=m){
cout<<"Pass"<<"\n"<<"*********************"<<"\n"<<"\n";
counterp+=1;
}
else{
cout<<"Fail"<<"\n"<<"*********************"<<"\n"<<"\n";
counterf+=1;
}
}
if (counter=y){
cout<<"Pass number: "<<counterp<<"\n";
cout<<"Fail number: "<<counterf<<"\n";
cout<<"Average: "<<ave/y<<endl;
}
getch();
return 0;
}