Program Konversi Jarak

# include <conio.h>
# include <iostream.h>

main()
{
int BA,BK,I,pil,bil,no;
float H;
char ulang;

clrscr();
cout <<"\n*************************************";
cout <<"\n* TUGAS AKHIR PRAKTIKUM C++ DASAR *";
cout <<"\n* PROGRAM KONVERSI JARAK *";
cout <<"\n*************************************";

do
{
clrscr();
cout <<"\n********************************";
cout <<"\n* KONVERSI VOLUME DARI METER^3 *";
cout <<"\n********************************";
cout <<"\n\n";
cout <<"1.Meter^3 - Kaki^3\n";
cout <<"2.Meter^3 - Yard^3\n";
cout <<"3.Exit";
cout <<"\n";
cout <<"\nMasukkan Pilihan Anda ! : "; cin >>pil;

switch(pil)
{
case 1:
clrscr();
do
{
cout <<"\n====================";
cout <<"\n= METER^3 - KAKI^3 =";
cout <<"\n====================";
cout <<"\n";
cout <<"\nMasukkan Bilangan Awal ! = "; cin >>BA;
cout <<"\nMasukkan Bilangan Akhir ! = "; cin >>BK;

if(BA>BK)
{
cout <<"\n\t\tANDA SALAH MEMASUKKAN BILANGAN";
cout <<"\n\t SEHARUSNYA BILANGAN AWAL < BILANGAN AKHIR";
cout <<"\n\n\nMENU UTAMA Tekan Sembarang Tombol !";
}
else
{
cout <<"\nMasukkan Interval ! = "; cin >>I;
cout <<"\n=========================";
cout <<"\n|No.| METER^3 | KAKI^3 |";
cout <<"\n=========================";

no=1;
for(bil=BA;bil<=BK;bil=bil+I)
{
H=bil/0.02832;
no=no+1;
cout <<"\n| "<<no<< " | "<<bil<<" | "<<H<<" |";
}
cout <<"\n---------------------------------";
cout <<"\n\nApakah Anda Ingin Mengulang Konversi ? [Y/T] : ";
cout <<"\n\nMENU UTAMA Tekan Sembarang Tombol !";
}
ulang=getche();
}
while(ulang=='Y'||ulang=='y');
break;

case 2:
clrscr();
do
{
cout <<"\n====================";
cout <<"\n= METER^3 - YARD^3 =";
cout <<"\n====================";
cout <<"\n";
cout <<"\nMasukkan Bilangan Awal ! = "; cin >>BA;
cout <<"\nMasukkan Bilangan Akhir ! = "; cin >>BK;

if(BA>BK)
{
cout <<"\n\t\tANDA SALAH MEMASUKKAN BILANGAN";
cout <<"\n\t SEHARUSNYA BILANGAN AWAL < BILANGAN AKHIR";
cout <<"\n\n\nMENU UTAMA Tekan Sembarang Tombol !";
}
else
{
cout <<"\nMasukkan Interval ! = "; cin >>I;
cout <<"\n=========================";
cout <<"\n|No.| METER^3 | YARD^3 |";
cout <<"\n=========================";

no=1;
for(bil=BA;bil<=BK;bil=bil+I)
{
H=bil/0.7645;
no=no+1;
cout <<"\n| "<<no<< " | "<<bil<<" | "<<H<<" |";
}
cout <<"\n---------------------------------";
cout <<"\n\nApakah Anda Ingin Mengulang Konversi ? [Y/T] : ";
cout <<"\n\nMENU UTAMA Tekan Sembarang Tombol !";
}
ulang=getche();
}
while(ulang=='Y'||ulang=='y');
break;

case 3:
default:
cout <<"\n\n\t\tTERIMA KASIH Telah Menggunakan Program Ini";
break;

}
}
while(pil!=3);
getch();

}

Posted in . Bookmark the permalink. RSS feed for this post.

Leave a Reply

Search

Support by Blogger ITN | Converted by LiteThemes.com