# data[].attributes.body
#include <iostream>

using namespace std struct Pelajar {
double ID; charnama [20]; intmarkah ; intmarkahBM; intmarkahMT; intmarkahSC; intpurata ;
};

Pelajar Pel; int main (){

cout << "please enter student name" ;

cin >> Pel.cName ;

cout << "enter marks math" ; cin >> Pel.iMath ;

cout << "enter marks Sc"; cin >> Pel.iSc ;

cout << "enter marks BM"

cin >> Pel.iBM ; pel.average= (pel.iMath + pel.iSc + pel.iBM)/3 ; pel.ave = pel.total/3;

cout <<"ave" <<pel.ave<< endl;

return 0; }

# data[].attributes.body
//first programme #include<iostream> using namespace std; struct Pelajar { double dID; char cNama; int matematik; int sains; int english; float purata;}; Pelajar Pelajar; int main() { cout << "Masukkan ID" ; cin >>Pelajar. dID; cout << "Masukkan Nama" ; cin >>Pelajar.cNama; cout << " matematik" ; cin >>Pelajar.matematik ; cout<< "sains" ; cin >>Pelajar.sains; cout << "english" ; cin >>Pelajar.english; Pelajar.Purata = (Pelajar.matematik + Pelajar.sains + Pelajar.english)/3; cout<< "Purata"<<Pelajar.Purata; return 0; }

# data[].attributes.body
#include <iostream> #include <iomanip> using namespace std ; { struct pelajar {string id;string nama;int markah;int purata; }; int main () { cout<<"masukkan id pelajar"; cin>>pelajar1.id; cout<<"masukkan nama pelajar"; cin>>pelajar1.nama; cout<<"masukkan markah math"; cin>>pelajar1.markahMAT; cout<<"masukkan markah BI"; cin>>pelajar1.markahBI; cout<<"masukkan markah BM"; cin>>pelajar1.markahBM; pelajar purata=(pel1.markahMATH+pel1.markahBI+pel1.markahBM)/3; cout<<"purata ialah:" cin>>pelajar+purata; Return 0; }

# data[].attributes.body
#include<iostream>
using namespace std;

struct pelajar
{
double dID;
char cNAME;
int iMATH;
int iBM;
int iSAINS;
float avg;
};

Pelajar Pel;

int main()

{
pelajar satu
cout<< "Enter student ID";
cin>> satu.dID;

cout<< "Enter student NAME";
cin>> satu.cNAME;

cout<< "Enter mark MATH";
cin>> satu.iBM;

cout<< "Enter mark BM";
cin>> satu.iBM;

cout<< "Enter mark SAINS";
cin>> satu.iSAINS;

pel.avg=(pel.iMATH+pel.iBM+pel.iSAINS)/3;

cout<< "avg"<<pel.avg<<endl;
}

return 0;

# data[].attributes.body
#include <iostream.h>

struct student

{
double ID;
char cNAME;
int MM;
int MS;
int MBM;
float purata;

};
pelajar pel1;

int main()

{
cout<<"Enter ID:";
cin>>pel1.ID;

cout<<"Enter NAME;":
cin>>pel1.NAME;

cout<<"Enter MM;";
cin>>pel1.MM;

cout<<"Enter MS;":
cin>>pel1.MS;

cout<<"Enter MBM;":
cin>>pel1.MBM;

pel1.purata=(pel1.MM+pel1.SS+pel1.MS+pel1.MBM/3

Cout<<"Purata:"<<pel1.purata;
return 0;

}

# data[].attributes.body
#include<string>

Struct rekodpelajar

{

String nama;

String id;

Int markah;

float purata;

};

Int main()

{  rekodpelajar pelajar 1;

Cout<<’’masukkan ID pel:’’;

Cin>>pelajar1.ID;

Cout<<masukkan markah pel:’’;

Cin>>pelajar1.markahBI>>pelajar.markahMAT>>pelajar.markahBM;  Pelajar1.purata=(pelajar1.MBI+pelajar1.MAT+Pelajar1.BM)/3;

Cout<<’’masukkan purata pel:’’;

Cin>>pelajar1.purata;

Return 0;

}

# data[].attributes.body
#include <iostream.h>

using namespace std;

struct pelajar[string Id;string Nama;int Markah;int Purata;
]

int main()

{

cout<<"masukkan id.Pelajar 1";

cin>>pelajar1.id;

cout<<"masukkan markah pelajar";

cin>>Pelajar1.markahMM>>markahMS>>markahMBM;

cout<<"masukkan purata pelajar";

cin>>(Pel1.markahMM+pel1.markahSC+pel1.markahBM)/3;

return 0;

{

# data[].attributes.body
#include<iomanip> using namespace std; struct pelajar{

double dID; char cname; int mm; int ms; int mbm; float puratamarkah; };

pelajar pel;

int main(){ cout<<"input ID:"; cin>> Pel.dID;

cout<<"input name:"; cin>>"pel.name;

cout>>input mm:"; cin<<pel.mm;

cout>>input ms:"; cin<<pel.ms;

cout>>input mbm:"; cin<<pel.mbm; pel.puratamarkah=(pel.mm+pel.ms+pel.mbm)/3; cout<<"purata markah anda:"; return 0; }

# data[].attributes.body
using namespace std; struct Student { char Name; int Math; int Sc; int Bi; float avg; }; Student Pel; int main () { cout <<"Enter the student name"; cin >>Pel.Name; cout <<"Enter mark Science"; cin >>Pel.Sc; cout <<"Enter mark English"; cin >>Pel.Bi; cout <<"Enter mark Mathematic"; cin >>Pel.Math; pel.average = pel.Math + pel.Sc + pel.Bi /3; cout <<"Average" <<pel.average <<endl;

# data[].attributes.body
#include <iostream> #include <string> using namespace std; int main () { double ID; char Name; float Average, Mark1, Mark2, Mark3; cout << "insert ID student"; cin>>ID; cout << "insert Name student"; cin>>Name; cout<< "insert Mathematic mark"; cin>>Mark1; cout<< "insert science mark"; cin>>Mark2; cout<< "insert physic mark"; cin>>Mark3; cout<<" (Mark1 + Mark2 + Mark3)/3"; cin>>Average;

return 0; }

# data[].attributes.body
#include<iostream.h> struct rekodpelajar { double ID; char NAMA; int MM,MS,MBM; float AVERAGE,TOTAL; } int main() } rekodpelajar pelajar1; cout<<"masukkan ID pelajar:"; cin>>pelajar1.ID; cin.ignore(); cout<<"masukkan NAMA:"; getline(cin,pelajar1.nama); cout<<"masukkan MM,MS,MB:"; cin>>pelajar1.markah; pel.total=pel.MBM+pel.MS+pel.MM pel.average=pel.total/3 cout<<"average"<<pel.average<<end; return 0; }

# data[].attributes.body
#include <iostream> #include <iomanip> using namespace std ; struct Pelajar ; { double dID; char cNama; int Mathematics; int Science; int English; float average; } Pelajar Pel; int main() { cout<<"Masukkan ID :"; cin>>Pel.dID ; cout<<"Masukkan Nama :"; cin>>Pel.cNama; cout<<"Masukkan markah mathematics :"; cin>>Pel.MM; cout<<"Masukkan markah science :"; cin>>Pel.MS; cout<<"Masukkan markah english :"; cin>>Pel.ME; Pelajar.purata=(pelajar.MM+pelajar.MS+pelajar.ME)/3; cout<<"Purata:"<<pelajar.purata; return 0;

}

# data[].attributes.body
#include <iostream> using namespace std ; struct PELAJAR { int ID; string name; double marksBM; double marksMM; double marksSN; double purata; }; PELAJAR pel; int main () { cout<<” Masukkan ID : ”; cin>>pel.ID; cout<<”Masukkkan Nama :”; cin>>pel.name ; cout<<” Masukkan markah BM:”; cin>>pel.marksBM ; cout<<” Masukkan markah Math:”; cin>>pel.marksMM ; cout<<” Masukkan markah Sains:”; cin>>pel.marksSN ; purata= (pel.marksBM+pel.marksMM+pel.marksSN)/3 ; cout<< " purata markah: " cin>> purata; return 0 ; }

# data[].attributes.body
#include<iostream>
using namespace std;

Struct Pelajar{

double dID;
char cNama[20];
int MarkahScience;
int MarkahMath;
int MarkahBM;
float purata;
};

Pelajar pel;
int main()

cout<<"Masukan Id pelajar";
cin>>pel.ID;
cout<<"Masukan name pelajar";
cin>>pel.CName;
count<<"Masukan Markah Science";
cin>>pel.MS;
count<<"Masukan Markah Math";
cin>>pel.MM;
count<<"Masukan Markah BM";
cin>>pel.MBM;

pel.average=(pel.MS+pel.MM+pel.MBM)/3

cout<<"purata pelajar";
cin>>pel.purata;

return 0;

# data[].attributes.body
#include<iostream> using namespace std; struct Pelajar{ double dID; char cNama; int markah sains; int markah bm; float purata; }; int main(){ cout<< "masukkan ID :" cin>> pelID cout<< "masukkan Nama:" cin>> pel.Nama cout<< "masukkan markah :" cin>> pel.markah pel purata=pel.markahsains+ pel.markah bm; cout<< "purata:"<<purata; return 0

# data[].attributes.body
#include <iostream> #include <iomanip> using namespace std; struct Pel { int ID MBM MS MM; string NAMA; float average ; }pelajarpel;

int main () cout<<"sila masukkan ID " cin >>Pel.ID; cout<<"Sila masukkan Nama" cin>>Pel.nama cout>>"sila masukkan markah bm" cin>>Pel.MBM cout>>"sila masukkan markah math" cin>>Pel.MM cout>>"sila masukkan markah Sains" cin>>Pel.MS float average; (pel.MBM+pel.MM+pel.MS)/3; cout<<"purata :"Pel.purata; return 0;

# data[].attributes.body
#include<iostream.h> using namespace std; struct Pelajar{ double dID; char cNama[22]; double diMarkahScience; double diMarkahMath; double diMarkahBm; }; Pelajar Pel; int main() { cout<< "Sila Masukkan ID :"; cin>>pel.dID/n; cout<< " Sila Masukkkan Nama :"; cin>> (pel.cNama,22,’/n’);

cout<< "Sila Masukkan MarkahScience :"; cin>>pel.diMarkahScience/n; cout<< "Sila Masukkan MarkahMath :"; cin>>pel.diMarkahMath/n; cout<< "Sila Masukkan MarkahBm :"; cin>>pel.diMarkahBm/n; pel.purata = pel.diMarkahScience + pel.diMarkahMath + pel.diMarkahBm/3;

cout << " Sila Masukkan Purata :" << pel.purata; return 0; }

# data[].attributes.body
#include <iostream>

using namespace std ;

struct pelajar

{

int Studentid;

double Name;

int MMath;

int MScience;

int MBM;

double Purata;

}

;

int main()

{

pelajar pel1;

cout << " Enter Studentid';

cin >> pel1.Studentid;

cout << "Enter student name";

cin >> pel1.Nama;

cout << " Enter MMath";

cin >>pel1.MMath;

cout << " Enter MScience";

cin >>pel1.MScience;

cout << " Enter MBM";

cin >>pel1.MBM;

pel.Purata = (pel1.MMath + pel1.MScience +pel1.MBM)/3;

cout << Average is: "

cin >> pel1.Purata ;

return O;

}

# data[].attributes.body
#include <iostream> #include <iomanip> using namespace std; struct pelajar { char cNama; int iMSC; int iMBM; int iMM; float fpurata; }; pelajar Pel;

int main()

{ cin<<"masukkan nama"; cout>>Pel.cNama; cin<<"masukkan markah science"; cout>>Pel.iMSC; cin<<"masukkan markah bahasa melayu"; cout>>Pel.iBM; cin>>"masukkan markah matematik"; cout>>Pel.iMM; Pel.purata = (Pel.iMSC + Pel.iBM + Pel.iMM)/3; return 0; }

# data[].attributes.body
#include<iostream>
using namespace std;
struct pelajar
{   double ID;
int markah;

int markahBM;

int markahSC; int markahMAT; int purata;
}; pelajar pel;
Int main()

{
cout<<”masukkan ID pel :”; cin>>pel.ID; cout<<”masukkan markah pel:”; cin>>pel.markahBM >>pel.markahMAT>>pel.markahSC ; pel.purata=(pel.BM+pel.MAT+pel.SC)/3 cout<<pel.purata; return 0; }

# data[].attributes.body
#include <iostream.h> using namespace std; struct Pelajar { double ID; char name [30]; int markah; int markahBM; int markahMatematik; int markahSains; int purata; }; pelajar; int main () { cout << " masukkan ID "; cin >> pelajar.ID; cout<< " masukkan nama "; cin >> pelajar.nama; cout << " masukkan markah "; cin >> pelajar.markahBM >> pelajar.markahmatematik >> pelajar.markahSains; pelajar.Purata = (markahBM+matkahmatematik+markahsains)/3; cout << " pelajar.purata"; cin >> pelajar.purata; return 0; }

# data[].attributes.body
#include<iostream.h>

struct pel1

{
double dID;
char cNama;
int matematik;
int sains;
int bm;
float purata;
};
pel1 pel[3];
int main()
{

for ( int=0;i<3;i++)
cout<<"masukkan id:";
cin>>pel[i].dId;

cout<,"masukkan nama:";
cin>>pel[i].cNama;

cout<<"masukkan markah matematik:";
cin>>pel[i].cMarkah matematik;

cout<<"masukkan markah sains:";
cin>>pel[i}.cMarkah sains;

cout<<"masukkan markah bahasa melayu:";
cin>>pel[i].cMarkah bm;

pel[i].purata=(pel[i].cMarkah matematik + pel[i].cMarkah sains + pel[i].cMarkah bm)/3;

cout<<"purata"<<pel[i].purata;

return 0;
}

# data[].attributes.body
#include <iostream>

using namespace std struct Pelajar {
double ID; charnama [20]; intmarkah ; intmarkahBM; intmarkahMT; intmarkahSC; intpurata ;
};
Pelajar pel;
int main ()
{ cout << “Masukkan ID”; cin >> pel.ID; cout << “masukkan nama”; cin >> pel.nama; cout << “masukkan markah”; cin >> pel.markahBM >> pel.markahMT >> pel.markahSC;
pel. purata = (markahBM + markahMT + markahSC)/3
cout << “purata pelajar”; cin >> pel.purata;
return 0;

}

# data[].attributes.body
#include <iostream.h> using namespace std; struct Pelajar { double ID; char name [30]; int markah; int markahBM; int markahMatematik; int markahSains; int purata; }; pelajar pel; int main () { cout << " masukkan ID "; cin >> pel.ID; cout<< " masukkan nama "; cin >> pel.nama; cout << " masukkan markah "; cin >> pel.markahBM >> pel.markahmatematik >> pel.markahSains; pel.Purata = (markahBM+matkahmatematik+markahsains)/3; cout << " purata.pel "; cin >> pel.purata; return 0; }

# data[].attributes.body
#include <iostream> using namespace std; struct Pelajar{

double dID; char cNama; float fMarkahScience; float fMarkahMathematics; float fMarkahEnglish; float fPurataMarkah; }; Pelajar pel; int main() { cout<<"Masukkan ID: "; cin>>pel.ID; cout<<"Masukkan Nama: "; cin>>pel.Nama; cout<<"Masukkan Markah Science: "; cin<<pel.MarkahScience; cout<<"Masukkan Markah Mathematics: "; cin<<pel.MarkahMathematics; cout<<"Masukkan Markah English: "; cin<<pel.MarkahEnglish; pel.PurataMarkah=(pel.MarkahScience+pel.MarkahMathematics+pel.MarkahEnglish)/3; cout<<"Purata Markah anda :"; return 0; }

# data[].attributes.body
#include <iostream.h> using namespace std; struct pelajar{ double dID; char cNama[30]; double dMarkahMath; double dMarkahSains; double dMarkahBMarkah;

}; Pelajar Pel; int main(){ cout<< "Masukkan ID :"; cin>> pel.dID; cout<< "Masukkan Nama :"; cin>> "pel.cNama,30,’/n’); cout<< "Masukkan Markah Math :"; cin>>pel.dMarkahMath; cout<< "Masukkan Markah Sains :"; cin>>pel.dMarkahSains; cout<< "Masukkan Markah BMelayu :"; cin>> pel.dMarkahBMelayu; cout>> pel.dID; cout>> "pel.cNama,30,’/n’); cout>>pel.dMarkahMath; cout>>pel.dMarkahSains; cout>> pel.dMarkahBMelayu; cout<< Pel.ID; Pel.purata = (Pel.MarkahMath + Pel.MarkahSains + Pel.MarkahBMelayu / 3; return 0; }

# data[].attributes.body
#include <iostream> using namespace std; struct Pelajar{ double dID; char cNama; float fPurataMarkah; float fMarkahBahasaMalayu; float fMarkahSains; float fMarkahGeografi; }; Pelajar Pel ; int main () { cout<<"Masukkan ID:"; cin>>pel.dID; cout<< "Masukkan Nama :"; cin>>pel.Nama; cout<<"Masukkan Markah Bahasa Melayu :"; cin>>pel.MarkahBahasaMelayu; cout<<"Masukkan Markah Sains:"; cin>>pel.MarkahSains; cout<<"Masukkan Markah Geografi:"; cin>>pel.MarkahGeografi; pel.PurataMarkah=(pel.MarkahBahasaMelayu+pel.MarkahSains+pel.MarkahGeografi)/3; cout<<"Purata Markah anda:"; return 0;

}

# data[].attributes.body
#include<iostream> #include<iomanip> using namespace std; struct pelajar { int studentID; double Name; int markMath; int markSc; int markBM; double purata; }; int main () { pelajar pel1; cout<<"Enter student ID"; cin>>pel1.studentID; cout<<"Enter student name"; cin>>pel1.Name; cout<<"Enter Math's mark"; cin>>pel1.markMath; cout<<"Enter Science's mark"; cin>>pel1.markSc; cout<<"Enter BM's mark"; cin>>pel1.markBM; pel.purata=(pel1.markMath+pel1.markSc+pel1.markBM)/3; cout<<"Average is:" cin>>pel1.purata; return 0; }

# data[].attributes.body
#include <iostream.h> using namespace std; struct Pelajar { double ID; char name [30]; int markah; int markahBM; int markahMatematik; int markahSains; int purata; }; pelajar; int main () { cout << " masukkan ID "; cin >> pelajar.ID; cout<< " masukkan nama "; cin >> pelajar.nama; cout << " masukkan markah "; cin >> pelajar.markahBM >> pelajar.markahmatematik >> pelajar.markahSains; pelajar.Purata = (markahBM+matkahmatematik+markahsains)/3; cout << " purata pelajar "; cin >> pelajar.purata; return 0; }

# data[].attributes.body
#include <iostream.h> using namespace std; struct pelajar { double ID; char name [30]; int markah; int markahBM; int markahMatematik; int markahSains; int purata; }; pelajar; int main () { cout << " masukkan ID "; cin >> pelajar.ID; cout<< " masukkan nama "; cin >> pelajar.nama; cout << " masukkan markah "; cin >> pelajar.markahBM >> pelajar.markahmatematik >> pelajar.markahSains; pelajar.Purata = (markahBM+matkahmatematik+markahsains)/3; cout << " purata pelajar "; cin >> pelajar.purata; return 0; }

# data[].attributes.body
#include <iostream.h>

using namespace.std;

struct Pelajar{

string nama;

double ID;

int marBM;

int marMath;

int marSains;

int purata;

};

Pelajar pel;

Int main()

{

cout<<”Masukkan nama”;

cin>>pel.nama;

cout<<”Masukkan ID”;

cin>>pel.ID;

cout<<”Masukkan markah BM”;

cin>>pel.marBM;

cout<<”Masukkan markah Matematik”;

cin>>pel.marMath;

cout<<”Masukkan markah Sains”;

cin>>pel.marSains;

pel.purata = (marBM+marMath+marSains)/3;

cout<<pel.purata;

return 0;

}

# data[].attributes.body
#include <iostream>
using namespace std; struct Pelajar {
double ID;
char nama [20];
int markah ;

int markahBM;
int markahMT; int markahSC; int purata ;
};
Pelajar pel;
int main ()
{
cout << “Masukkan ID”; cin >> pel.ID; cout << “masukkan nama”; cin >> pel.nama; cout << “masukkan markah”; cin >> pel.markahBM >> pel.markahMT >> pel.markahSC;
pel. purata = (markahBM + markahMT + markahSC)/3
cout << “purata pelajar”; cin >> pel.purata;
return 0;

}

# data[].attributes.body
#include<iostream> using namespace std; #include<iostream> using namespace std;

struct Pelajar{

double dID; char cNama[20]; int Markah sains; int Markah BM; float purata; };

Pelajar pel; int main(){ cout<<” Masukkan ID : ”; cin>>pel.dID; cout<<”Masukkkan Nama :”; cin>>get(pel.cNama,20,’/n’);

cout<<" Masukan markah sains,:"; cin>>pel.Markah sains; cout<<" Masukan markah BM,:"; cin>>pel.Markah BM; pel.purata= (pel.Markah sains+pel.Markah BM)/2; cout << "Purata :" << pel.purata;

return 0; }

# data[].attributes.body
#include<iomanip> using namespace std; struct Pelajar { char cNama; float fMM; float fMSN; float fBM; float fPurata; }; Pelajar pel; int main () { cout << "masukkan ID : "; cin>>pel.cNama; cout << "masukkan markah Math : "; cin>>pel.fMM; cout << "masukkan markah Sains : "; cin>>pel.fMSN; cout << "masukkan markah BM : "; cin>>pel.fBM; pel.Purata = (pel.fMM+pel.fMSN+pel.fBM)/3; cout << "purata adalah : "; cin>>pel.Purata; return 0; }

# data[].attributes.body
#include <iostream.h> using namespace std; struct Student { char cName [i]; int iMath; int iSc; int iBM; float ave; }; Pelajar Pel; int main (){ cout << "please enter student name" ; cin >> Pel.cName ; cout << "enter marks math" ; cin >> Pel.iMath ; cout << "enter marks Sc"; cin >> Pel.iSc ; cout << "enter marks BM" cin >> Pel.iBM ; pel.average= (pel.iMath + pel.iSc + pel.iBM)/3 ; pel.ave = pel.total/3;

cout <<"ave" <<pel.ave<< endl;

return 0; }

# data[].attributes.body
#include <iostream.h>

struct Pelajar

{ double dID; char cNama; int MM; int MS; int MBM; float purata; };

Pelajar pelajar;

int main() { cout <<"Masukkan ID :"; cin >> pelajar.dID; cout<< "Masukkkan Nama :"; cin >> pelajar.cNama; cout <<"Markah Matematik :"; cin >> pelajar.MM; cout <<"Markah Sains:"; cin >> pelajar.MS; cout<<"Markah Bahasa Melayu:"; cin>> pelajar.MBM; pelajar.purata = (pelajar.MM + pelajar.MS + pelajar.MBM)/3; cout << "Purata :" << pelajar.purata; return 0; }

# data[].attributes.body
#include <iostream>

using namespace std;

struct Pelajar{

string nama;

int ID,MBM, MM, MS;
float purata; };
Pelajar pel[3];

int main(){

for (int i= 0;i<3;i++)

cin>>pel[i].nama; cin>>pel[i].ID;

cin>>pel[i].MBM; cin>>pel[i].MM; cin>>pel[i].Ms;

pel[i].purata=(pel[i].MBM + pel[i].MM + pel[i].MS)/3; cout<<pel[i].purata;

return 0;

}

# data[].attributes.body
#include<iostream> using namespace std; struct Pelajar{ string name; int ID,MBM,MM,MS; float average,total; }; Pelajar pel; int main() { cin>>pel.name; cin>>pel.ID; cin>>pel.MBM; cin>>pel.MS; cin>>pel.MM; pel.total=pel.MBM+pel.MS+pel.MM; pel.average=pel.total/3; cout<<"Average"<<pel.average<<endl; return 0; }

# data[].attributes.body
struct PEL{

double ID;

char nama[10];

float MM, MS, MBM;

float ave;

};

PEL pel1;

int main(){

cin>> pel1.ID;

cin.get(pel1.nama, 10, '/n');

cin>>pel1.MM>>pel1.MS>>pel1.MBM;

pell.ave = (pel1.MM+pel1.MS+pel1.MBM)/3;

cout>> "ID:"<<pel1.ID;

cout>> "Nama:"<<pel1.nama;

cout>> "Purata Markah:"<<pel1.purata;

}