SEMESTER 1
LOGIKA & ALGORITMA
TUGAS TELOMPOK PERTEMUAN 2
# KELOMPOK SILENT TEAM #
1. HARIS SYAEFUL AMRI [NIM : 13190183]
2. PATAR SAMUEL [NIM : 13190497]
2. PATAR SAMUEL [NIM : 13190497]
3. IKHWAN HAFIZH [NIM : 13190090]
4. MULYANSYAH YUSUF [NIM : 13190088]
5. SOLIKIN [NIM : 13190515]
KELAS : 13.1B.07
JURUSAN : TEKNIK KOMPUTER
Membuat program sederhana dengan menggunakan C++
• Menghitung Luas lingkaran
• Menghitung Luas Persegi Panjang
• Menghitung Luas Bujur Sangkar
Catatan :
- Pergunakan fungsi cin dan cout atau scanf dan printf
- Tampilkan NIM, Nama & Kelas pada program tersebut
- Listing progam & output dicetak
1. Menghitung Luas Lingkaran
Input Script :
#include <stdlib.h>
#include <stdio.h>
int main()
{
int r;
float phi, luas;
phi=3.14;
printf(" # KELOMPOK SILENT TEAM # ");
printf("\n");
printf(" ====================================");
printf("\n");
printf(" |NO| NAMA | NIM |");
printf("\n");
printf(" ====================================");
printf("\n");
printf(" |1 | HARIS SYAEFUL AMRI | 13190183 |");
printf("\n");
printf(" |2 | PATAR SAMUEL | 13190497 |");
printf("\n");
printf(" |3 | IKHWAN HAFIZH | 13190090 |");
printf("\n");
printf(" |4 | MULYANSYAH YUSUF | 13190088 |");
printf("\n");
printf(" |5 | SOLIKIN | 13190515 |");
printf("\n");
printf(" ====================================");
printf("\n");
printf(" KELAS : 13.1B.07 ");
printf("\n");
printf(" JURUSAN : TEKNIK KOMPUTER ");
printf("\n");
printf(" TAHUN AJARAN : 2019/2020 ");
printf("\n");
printf("\n\t\t**MENGHITUNG LUAS LINGKARAN**");
printf("\n\Masukan Jari-Jari Lingkaran (cm) = ",r);
scanf("%i",&r);
luas=phi*r*r;
printf("Luas Lingkaran = %f \n",luas);
system ("pause");
return 0;
}
#include <stdio.h>
int main()
{
int r;
float phi, luas;
phi=3.14;
printf(" # KELOMPOK SILENT TEAM # ");
printf("\n");
printf(" ====================================");
printf("\n");
printf(" |NO| NAMA | NIM |");
printf("\n");
printf(" ====================================");
printf("\n");
printf(" |1 | HARIS SYAEFUL AMRI | 13190183 |");
printf("\n");
printf(" |2 | PATAR SAMUEL | 13190497 |");
printf("\n");
printf(" |3 | IKHWAN HAFIZH | 13190090 |");
printf("\n");
printf(" |4 | MULYANSYAH YUSUF | 13190088 |");
printf("\n");
printf(" |5 | SOLIKIN | 13190515 |");
printf("\n");
printf(" ====================================");
printf("\n");
printf(" KELAS : 13.1B.07 ");
printf("\n");
printf(" JURUSAN : TEKNIK KOMPUTER ");
printf("\n");
printf(" TAHUN AJARAN : 2019/2020 ");
printf("\n");
printf("\n\t\t**MENGHITUNG LUAS LINGKARAN**");
printf("\n\Masukan Jari-Jari Lingkaran (cm) = ",r);
scanf("%i",&r);
luas=phi*r*r;
printf("Luas Lingkaran = %f \n",luas);
system ("pause");
return 0;
}
Output Program
2. Menghitung Luas Persegi Panjang
Input Script :
#include <iostream>
#include "conio.h"
int main()
{
int p, l;
cout<<" # KELOMPOK SILENT TEAM # "<<endl;
cout<<" ===================================="<<endl;
cout<<" |NO| NAMA | NIM |"<<endl;
cout<<" ===================================="<<endl;
cout<<" |1 | HARIS SYAEFUL AMRI | 13190183 |"<<endl;
cout<<" |2 | PATAR SAMUEL | 13190497 |"<<endl;
cout<<" |3 | IKHWAN HAFIZH | 13190090 |"<<endl;
cout<<" |4 | MULYANSYAH YUSUF | 13190088 |"<<endl;
cout<<" |5 | SOLIKIN | 13190515 |"<<endl;
cout<<" ===================================="<<endl;
cout<<" KELAS : 13.1B.07 "<<endl;
cout<<" JURUSAN : TEKNIK KOMPUTER "<<endl;
cout<<" TAHUN AJARAN : 2019/2020 "<<endl;
cout<<endl;
cout<<"\n\tProgram Menghitung Luas Persegi Panjang"<<endl;
cout <<"\t=======================================\n";
cout<<"Masukkan Nilai Panjang = ";
cin>>p;
cout<<"Masukkan Nilai Lebar = ";
cin>>l;
cout<<"Luas Persegi Panjang = "; cout<<(p*l);
getch();
}
#include "conio.h"
int main()
{
int p, l;
cout<<" # KELOMPOK SILENT TEAM # "<<endl;
cout<<" ===================================="<<endl;
cout<<" |NO| NAMA | NIM |"<<endl;
cout<<" ===================================="<<endl;
cout<<" |1 | HARIS SYAEFUL AMRI | 13190183 |"<<endl;
cout<<" |2 | PATAR SAMUEL | 13190497 |"<<endl;
cout<<" |3 | IKHWAN HAFIZH | 13190090 |"<<endl;
cout<<" |4 | MULYANSYAH YUSUF | 13190088 |"<<endl;
cout<<" |5 | SOLIKIN | 13190515 |"<<endl;
cout<<" ===================================="<<endl;
cout<<" KELAS : 13.1B.07 "<<endl;
cout<<" JURUSAN : TEKNIK KOMPUTER "<<endl;
cout<<" TAHUN AJARAN : 2019/2020 "<<endl;
cout<<endl;
cout<<"\n\tProgram Menghitung Luas Persegi Panjang"<<endl;
cout <<"\t=======================================\n";
cout<<"Masukkan Nilai Panjang = ";
cin>>p;
cout<<"Masukkan Nilai Lebar = ";
cin>>l;
cout<<"Luas Persegi Panjang = "; cout<<(p*l);
getch();
}
3. Menghitung Luas Bujur Sangkar
Input Script :
#include <stdio.h>
#include <conio.h>
#include <iostream>
main()
{
int S, Sisi, L;
cout<<" # KELOMPOK SILENT TEAM # "<<endl;
cout<<" ===================================="<<endl;
cout<<" |NO| NAMA | NIM |"<<endl;
cout<<" ===================================="<<endl;
cout<<" |1 | HARIS SYAEFUL AMRI | 13190183 |"<<endl;
cout<<" |2 | PATAR SAMUEL | 13190497 |"<<endl;
cout<<" |3 | IKHWAN HAFIZH | 13190090 |"<<endl;
cout<<" |4 | MULYANSYAH YUSUF | 13190088 |"<<endl;
cout<<" |5 | SOLIKIN | 13190515 |"<<endl;
cout<<" ===================================="<<endl;
cout<<" KELAS : 13.1B.07 "<<endl;
cout<<" JURUSAN : TEKNIK KOMPUTER "<<endl;
cout<<" TAHUN AJARAN : 2019/2020 "<<endl;
cout<<endl;
cout<<"Menghitung Luas Bujur Sangkar"<<endl;
cout<<"Nilai Sisi = ";cin>>S;
cout<<"Nilai Sisi = ";cin>>Sisi;
L=S*Sisi;
cout<<"Nilai Luas = "<<L;
getch();
}
Output Program
No comments:
Post a Comment