Anda di halaman 1dari 8

TUGAS

ALGORITMA DAN PEMROGRAMAN


II

Disusun

Oleh :

HERI

PURNAMA

125410101

MUKTI WIJAYA

125410077

Sekolah Tinggi Manajemen Informatika dan Komputer

KAKOM

Yogyakarta
2015
1.Tugas Pertama
#include
#include
#include
#include

<iostream.h>
<conio.h>
<stdio.h>
<iomanip.h>

main(){
int a,b;
float jumlah,jumlah1;
float data[2][2];
data[0][0]=60;
data[0][1]=70;
data[1][0]=80;
data[1][1]=30;
cout<<"\n=================\n";
cout<<"Thn/Jur\t TI SI"<<endl;
cout<<"----------------------------------";
cout<<endl;
cout<<"2013\t";
for(a=0;a<2;a++)
{
for(b=0;b<2;b++)
{
cout<<data[a][b];
cout<<" ";
}
cout<<endl;
cout<<"2014\t";
}
cout<<endl;
jumlah=data[0][0]+data[1][0];
jumlah1=data[0][1]+data[1][1];
cout<<"----------------------------------"<<endl;
cout<<"Total :
"<<jumlah<<" "<<jumlah1<<endl;
cout<<"----------------------------------";
getch();
}

Output

2.Tugas 2

#include <iostream.h>
#include <conio.h>
void main (){
int pil,mob,mot;
cout << "menu"<<endl;
cout << "1 . Mobil" <<endl;
cout << "2 . Motor"
<<endl;
cout << "3 . Batal"
<<endl;
cout << "masukan pilihan anda = ";
cin >> pil;
if(pil == 1){
cout << "Mobil" <<endl;
cout << "10.Sedan"
<<endl;
cout << "11.Mini Bus"
<<endl;
cout << "masukan pilihan = ";
cin >> mob;
if(mob == 10){
cout << "Sedan" <<endl;
}
else{
cout << "Mini Bus" <<endl;
}
}
else if(pil == 2){
cout << "Motor" <<endl;
cout << "21.Motor Matik"<<endl;
cout << "22.Motor Standart"
<<endl;
cout << "masukan pilihan = ";
cin >> mot;
if(mot == 21){
cout << "Motor Matic" <<endl;
}
else{
cout << "Motor Standart"<<endl;
}
}
else{
cout << "Tidak memenuhi" <<endl;
}
getch();
}

2.Tugas 2
a.Flow chart

b.Program
Script
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
void main ()
{
int jenis, merk, merk1,n1;
int hasil;
char x;

clrscr();
awal:
cout<<endl<<endl;
cout<<"=================================================================="<<endl;
cout<<"||------------------------------------------ PENJUALAN MOTOR DAN MOBIL TOKOkU
-----------------------------------||"<<endl;
cout<<"=================================================================="<<endl;
cout<<"Daftar Produk: "<<endl;
cout<<"-----------------------------------------------------------------------------------------------------------------------------------"<<endl;
cout<<"1. Mobil "<<endl;
cout<<"2. Motor "<<endl;
cout<<"3. Batal "<<endl;
cout<<"________________________________________________________________________________
________"<<endl;
cout<<"Pilih Produk Yang Ingin Dibeli : "<<" ";
cin>>jenis;
if(jenis==1)
{
cout<<"SILAHKAN PILIH MERK MOBIL YANG ANDA INGINKAN :"<<endl;
cout<<"10 = SEDAN"<<endl;
cout<<"11 = BEBAS"<<endl;
cout<<"________________________________________________________________________________
________"<<endl;
cout<<"PILIH MERK: ";
cin>>merk;
if(merk==10)
{
cout<<endl;
cout<<"Harga Rp.170.000.000"<<endl;

cout<<"________________________________________________________________________________
________"<<endl;
cout<<"Jumlah Mobil Yang Dibeli:"<<" ";
cin>>n1;
hasil=n1*170000000;
cout<<"==>>"<<"Rp."<<hasil<<endl;
if(hasil==170000000){
cout<<"TerimaKasih Telah membeli Produk Kami , Permintaan
anda sedang kami Proses"<<endl;
}
else if(hasil>=340000000 && hasil<=510000000){
cout<<"Selamat Anda Mendapatkan Hadiah Bonus
Jaket"<<endl;
cout<<"TerimaKasih Telah membeli Produk Kami ,
Permintaan anda sedang kami Proses";
}
else if(hasil>=510000000){
cout<<"Selamat Anda Mendapatkan Hadiah Bonus Jaket &
Payung"<<endl;
cout<<"TerimaKasih Telah membeli Produk Kami ,
Permintaan anda sedang kami Proses";
}
}

else if (merk==11)
{
cout<<"OKE . Permintaan anda sedang kami Proses";
}
else
{
cout<<" "<<endl;
cout<<"---- !!!!!!!!!!!!!!!!!!!!!!!!!---------"<<endl;
cout<<"Pilihan Yang anda masukkan Salah "<<endl;
cout<<"---- !!!!!!!!!!!!!!!!!!!!!!!!!---------"<<endl;
}
}
if(jenis==2)
{
cout<<"SILAHKAN PILIH MERK MOBIL YANG ANDA INGINKAN :"<<endl;
cout<<"21 = MATIK"<<endl;
cout<<"22 = BEBAS"<<endl;
cout<<"________________________________________________________________________________
________"<<endl;
cout<<"PILIH MERK: ";
cin>>merk1;
if(merk1==21)
{
cout<<endl;
cout<<"Harga Rp.20.000.000"<<endl;

cout<<"________________________________________________________________________________
________"<<endl;
cout<<"Jumlah Motor Yang Dibeli:"<<" ";
cin>>n1;
hasil=n1*20000000;
cout<<"==>>"<<"Rp."<<hasil<<endl;
if(hasil==20000000){
cout<<"TerimaKasih Telah membeli Produk Kami , Permintaan
anda sedang kami Proses"<<endl;
}
else if(hasil>=40000000 && hasil<=50000000){
cout<<"Selamat Anda Mendapatkan Hadiah Bonus
Jaket"<<endl;
cout<<"TerimaKasih Telah membeli Produk Kami ,
Permintaan anda sedang kami Proses";
}
else if(hasil>=50000000){
cout<<"Selamat Anda Mendapatkan Hadiah Bonus Jaket &
Helm"<<endl;
cout<<"TerimaKasih Telah membeli Produk Kami ,
Permintaan anda sedang kami Proses";
}
}
else if (merk==22)
{
cout<<"OKE . Permintaan anda sedang kami Proses";
}
else

{
cout<<" "<<endl;
cout<<"---- !!!!!!!!!!!!!!!!!!!!!!!!!---------"<<endl;
cout<<"Pilihan Yang anda masukkan Salah "<<endl;
cout<<"---- !!!!!!!!!!!!!!!!!!!!!!!!!---------"<<endl;
}
}
cout<<endl<<endl;
cout<<"-----------------------------------------------------------------------------------------------------------------------------------"<<endl;
cout<<"Dan Terimakasih Atas Kunjungan Anda" <<endl;
cout<<"-----------------------------------------------------------------------------------------------------------------------------------"<<endl;
cout<<endl<<endl;
cout<<endl<<endl;
cout<<"Kembali Ke Menu Utama Pilih [Y] Jika Tidak [T] : ";
cin>>x;
if (x == 'Y' || x == 'y')
{
clrscr();
goto awal;
}
else if(x =='T' || x =='t')
{
terminate();
}
getche();
}

Output