TugasKode_Record.docx - -TUGAS 1(PENJELASAN CODE#include...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
--------------------------------------------------------------------------------------------------------------------------- TUGAS 1 (PENJELASAN CODE) --------------------------------------------------------------------------------------------------------------------------- #include <iostream> //menggunakan library dari c++ using namespace std; //menggunakan semua command untuk std:: main(){ typedef struct{ //deklarasi tipe data abstrak char nama_as[20]; //tipe data char int nim_as; //tipe data integer float ip1,ip2,ip3,upah,jam,ip,gaji; //tipe data float } data1; //nama tipe data typedef struct{ char nama_dos[20]; int npy; float ipmax,ipmin; data1 yes[20]; } komplit; komplit ok[20]; //deklarasi variable berdasarkan tipe data int y,z,x,a; //deklarasi variable integer char b[10]; //bagian input cout<<"masukkan jumlah dosen : ",cin>>y; for(z=0;z<y;z++){ //looping sebanyak jumlah dosen cout<<"\nMasukkan data Dosen ke "<<z+1<<endl<<cin.getline(b,10); //cin.ignore untuk mencegah input yang diinginkan di-skip cout<<"\n\nNama Dosen : ",cin.getline(ok[z].nama_dos,sizeof(ok[z].nama_dos)); cout<<"NPY Dosen : ",cin>>ok[z].npy; cout<<"Jumlah mengampu : ",cin>>x; ok[z].ipmax=0; ok[z].ipmin=4; for(a=0;a<x;a++){ //looping sebanyak jumlah as-dos cin.ignore();
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
cout<<"Nama Asisten "<<a+1<<" : ",cin.getline(ok[a].yes[a].nama_as,sizeof(ok[a].yes[a].nama_as)); //input ke nama_as di dalam record
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern