Subject 1 (0.00) :
Subject 2 (0.00) :
Subject 3 (0.00) :
Subject 4 (0.00) :
Subject 5 (0.00) :
CPA:
FORMULA:
CPA = ((Subject1*3) + (Subject2*3) + (Subject3*2) + (Subject4*2) + (Subject5*4)) / 5
Answer :
#include < iostream.h >
main()
{
//declair variable
float s1, s2, s3, s4, s5, cpa;
cout<<"Muhammad FIrdaus Bin Hasmi" << endl;
cout<<"05-201006-00003" << endl;
//input1
cout<<"\nSubject 1 = ";
cin>>s1;
//input2
cout<<"Subject 2 = ";
cin>>s2;
//input3
cout<<"Subject 3 = ";
cin>>s3;
//input4
cout<<"Subject 4 = ";
cin>>s4;
//input5
cout<<"Subject 5 = ";
cin>>s5;
//process
cpa=(((s1*3)+(s2*3)+(s3*2)+(s4*2)+(s5*4))/5);
//output
cout<<"\nSubject 1 : " << s1;
cout<<"\nSubject 2 : " << s2;
cout<<"\nSubject 3 : " << s3;
cout<<"\nSubject 4 : " << s4;
cout<<"\nSubject 5 : " << s5 << endl;
cout<<"\nCPA is : " << cpa << endl << endl;
return 0;
}
Questions :
No comments:
Post a Comment