Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- class record{
- public:
- int S1;
- int S2;
- int S3;
- int S4;
- };
- int main()
- {
- int S1,S2,S3,S4;
- record a;
- a.S1=S1;
- a.S2=S2;
- a.S3=S3;
- cout<<"Enter the marks of Subject 1 out of 80 ";
- cin>>S1;
- cout<<"Enter the marks of Subject 2 out of 80 ";
- cin>>S2;
- cout<<"Enter the marks of Subject 3 out of 80 ";
- cin>>S3;
- cout<<"Enter the marks of Subject 4 out of 80 ";
- cin>>S4;
- cout<<"The Average score is "<<(a.S1+a.S2+a.S3+S4)/4<<endl;
- cout<<"The Percentage is "<<(a.S1+a.S2+a.S3+S4)*10/32<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement