Odpowiedź:
#include <iostream>
using namespace std;
int main()
{
int p,f;
float s;
cout<<"Podaj aktualna liczbe punktow"<<endl;
cin>>p;
cout<<"Podaj frekwencje klasy w %"<<endl;
cin>>f;
cout<<"Podaj srednia klasy"<<endl;
cin>>s;
if(f<=50)
{
p = p-15;
}else if(f>50 && f<=70)
{
p=p-5;
}else if(f>70)
{
if(s>4.5)
{
p=p+20;
}else if(s>=3.5 && s<=4.5)
{
p=p+5;
}else
{
cout<<"brak zmian"<<endl;
}
}
cout<<"wynik "<<p<<endl;
return 0;
}
Wyjaśnienie:
Kod napisany w jak najprostszy sposób.