Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string sub,tf;
- int m1,m2,m3,m4,sum,TEZA;
- double avg;
- cout<<"SIMPLE AVERAGE CALCULATOR";
- cout<<"\n"<<"\n"<<"Subject at hand?: ";
- cin >> sub;
- cout <<"\n"<< "Input the FOUR marks you'd like verified: "<<"\n";
- cout<<"\n"<<"M1: ";cin >> m1;
- cout<<"\n"<<"M2: ";cin >> m2;
- cout<<"\n"<<"M3: ";cin >> m3;
- cout<<"\n"<<"M4: ";cin >> m4;
- cout<<"\n"<<"Would you like to include the TEZA grade?(Y/N): ";
- cin>>tf;
- sum=m1+m2+m3+m4;
- avg=(double)sum/4;
- if (tf=="Y"){
- cout<<"What is the TEZA grade?: ";
- cin>>TEZA;
- cout<<"\n"<<"Your average grade at "<<sub<<" is "<<((double)avg*3+TEZA)/4<<"\n"<<"\n";}
- else
- cout<<"\n"<<"Average at "<<sub<<" is "<<avg<<"\n"<<"\n";
- cout<<"DO YOU PASS?: "<<"\n";
- if (avg>=5)
- cout<<"Yes."<<"\n";
- else
- cout<<"No."<<"\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement