# 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();
}
Search
Categories
- Part I : Perkenalan (4)
- Part II : Operator (3)
- Part III : Percabangan (materi) (2)
- Part III : Percabangan (program) (4)
- Part IV : Perulangan (meteri) (3)
- Part IV : Perulangan (program) (3)
- Part V : Array (materi) (1)
- Part V : Array (program) (2)
- Penerapan (6)
- Pointer (2)
- Searching (pencarian) (3)
- Typedef (1)