# include <iostream.h>
# include <conio.h>
# include <iomanip.h>
# include <stdio.h>
void meter (float s)
{float inci, feet, yard,mil, km;
inci= s*39.37008;
cout<< s << " meter : " << setprecision(7)<<inci<<" inci"<<"\n";
feet=s*3.28084;
cout<< s << " meter : " << setprecision(7)<<feet<<" feet"<<"\n";
yard= s*1.09361;
cout<< s << " meter : " << setprecision(7)<<yard<<" yard"<<"\n";
mil= s/0.00062;
cout<< s << " meter : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.001;
cout<< s << " meter : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void inci (float s)
{float meter, feet, yard, mil, km;
meter = s/0.0254;
cout<< s << " inci : " << setprecision(7)<<meter<<" meter"<<"\n";
feet=s/0.08333;
cout<< s << " inci : " << setprecision(7)<<feet<<" feet"<<"\n";
yard= s/0.02778;
cout<< s << " inci : " << setprecision(7)<<yard<<" yard"<<"\n";
mil= s/0.00002;
cout<< s << " inci : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.00003;
cout<< s << " inci : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void feet (float s)
{float meter, inci, yard, mil, km;
meter = s/0.3048;
cout<< s << " kaki : " << setprecision(7)<<meter<<" meter"<<"\n";
inci = s*12;
cout<< s << " kaki : " << setprecision(7)<<inci<<" inci"<<"\n";
yard= s/0.33333;
cout<< s << " kaki : " << setprecision(7)<<yard<<" yard"<<"\n";
mil= s/0.00019;
cout<< s << " kaki : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.0003;
cout<< s << " kaki : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void yard (float s)
{float meter, inci, feet, mil, km;
meter = s/0.9144;
cout<< s << " yar : " << setprecision(7)<<meter<<" meter"<<"\n";
inci = s*36;
cout<< s << " yar : " << setprecision(7)<<inci<<" inci"<<"\n";
feet= s*3;
cout<< s << " yar : " << setprecision(7)<<feet<<" feet"<<"\n";
mil= s/0.00057;
cout<< s << " yar : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.00091;
cout<< s << " yar : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void mil (float s)
{float meter, inci,feet, yard, km;
meter = s*1609.344;
cout<< s << " mil : " << setprecision(7)<<meter<<" meter"<<"\n";
inci = s*63360;
cout<< s << " mil : " << setprecision(7)<<inci<<" inci"<<"\n";
feet= s*5280;
cout<< s << " mil : " << setprecision(7)<<feet<<" kaki"<<"\n";
yard= s*1760;
cout<< s << " mil : " << setprecision(7)<<yard<<" yar"<<"\n";
km= s*1.60934;
cout<< s << " mil : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void km (float s)
{float meter, inci,feet, yard, mil;
meter = s*1000;
cout<< s << " km : " << setprecision(20)<<meter<<" meter"<<"\n";
inci = s*39370.079;
cout<< s << " km : " << setprecision(20)<<inci<<" inci"<<"\n";
feet= s*3280.84;
cout<< s << " km : " << setprecision(20)<<feet<<" kaki"<<"\n";
yard= s*1093.613;
cout<< s << " km : " << setprecision(20)<<yard<<" yar"<<"\n";
mil= s/0.621;
cout<< s << " km : " << setprecision(20)<<mil<<" mil"<<"\n";
return;}
main()
{float s;
int pil,jawab;
cout<<"SELAMAT DATANG DI CONVERTER DISTANCES"<<"\n\n";
cout<<"Masukan Pilihan Satuan Anda Sebelum Diubah : "<<"\n";
cout<<"1= Meter/Metres"<<"\n";
cout<<"2= Inci/Inches"<<"\n";
cout<<"3= Kaki/Feet"<<"\n";
cout<<"4= Yar/Yard"<<"\n";
cout<<"5= Mil/Miles"<<"\n";
cout<<"6= Kilometer/Kilometres"<<"\n";
cout<<"Masukan Pilihan Anda : "<<"\n";
cin>>pil;
if (pil==1)
cout<<"Anda Memilih Satuan Meter"<<"\n";
else
if (pil==2)
cout<<"Anda Memilih Satuan Inci"<<"\n";
else
if (pil==3)
cout<<"Anda Memilih Satuan Kaki"<<"\n";
else
if (pil==4)
cout<<"Anda Memilih Satuan Yar"<<"\n";
else
if (pil==5)
cout<<"Anda Memilih Satuan Mil"<<"\n";
else
if (pil==6)
cout<<"Anda Memilih Satuan Km" <<"\n";
cout<<"Sekarang Masukan Angka Yang Anda Inginkan : ";
cin>>s;
if (pil==1)
meter (s);
else
if (pil==2)
inci (s);
else
if (pil==3)
feet (s);
else
if (pil==4)
yard (s);
else
if (pil==5)
mil (s);
else
if (pil==6)
km (s);
getch ();
return 0;}
# include <conio.h>
# include <iomanip.h>
# include <stdio.h>
void meter (float s)
{float inci, feet, yard,mil, km;
inci= s*39.37008;
cout<< s << " meter : " << setprecision(7)<<inci<<" inci"<<"\n";
feet=s*3.28084;
cout<< s << " meter : " << setprecision(7)<<feet<<" feet"<<"\n";
yard= s*1.09361;
cout<< s << " meter : " << setprecision(7)<<yard<<" yard"<<"\n";
mil= s/0.00062;
cout<< s << " meter : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.001;
cout<< s << " meter : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void inci (float s)
{float meter, feet, yard, mil, km;
meter = s/0.0254;
cout<< s << " inci : " << setprecision(7)<<meter<<" meter"<<"\n";
feet=s/0.08333;
cout<< s << " inci : " << setprecision(7)<<feet<<" feet"<<"\n";
yard= s/0.02778;
cout<< s << " inci : " << setprecision(7)<<yard<<" yard"<<"\n";
mil= s/0.00002;
cout<< s << " inci : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.00003;
cout<< s << " inci : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void feet (float s)
{float meter, inci, yard, mil, km;
meter = s/0.3048;
cout<< s << " kaki : " << setprecision(7)<<meter<<" meter"<<"\n";
inci = s*12;
cout<< s << " kaki : " << setprecision(7)<<inci<<" inci"<<"\n";
yard= s/0.33333;
cout<< s << " kaki : " << setprecision(7)<<yard<<" yard"<<"\n";
mil= s/0.00019;
cout<< s << " kaki : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.0003;
cout<< s << " kaki : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void yard (float s)
{float meter, inci, feet, mil, km;
meter = s/0.9144;
cout<< s << " yar : " << setprecision(7)<<meter<<" meter"<<"\n";
inci = s*36;
cout<< s << " yar : " << setprecision(7)<<inci<<" inci"<<"\n";
feet= s*3;
cout<< s << " yar : " << setprecision(7)<<feet<<" feet"<<"\n";
mil= s/0.00057;
cout<< s << " yar : " << setprecision(7)<<mil<<" mil"<<"\n";
km= s/0.00091;
cout<< s << " yar : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void mil (float s)
{float meter, inci,feet, yard, km;
meter = s*1609.344;
cout<< s << " mil : " << setprecision(7)<<meter<<" meter"<<"\n";
inci = s*63360;
cout<< s << " mil : " << setprecision(7)<<inci<<" inci"<<"\n";
feet= s*5280;
cout<< s << " mil : " << setprecision(7)<<feet<<" kaki"<<"\n";
yard= s*1760;
cout<< s << " mil : " << setprecision(7)<<yard<<" yar"<<"\n";
km= s*1.60934;
cout<< s << " mil : " << setprecision(7)<<km<<" km"<<"\n";
return;}
void km (float s)
{float meter, inci,feet, yard, mil;
meter = s*1000;
cout<< s << " km : " << setprecision(20)<<meter<<" meter"<<"\n";
inci = s*39370.079;
cout<< s << " km : " << setprecision(20)<<inci<<" inci"<<"\n";
feet= s*3280.84;
cout<< s << " km : " << setprecision(20)<<feet<<" kaki"<<"\n";
yard= s*1093.613;
cout<< s << " km : " << setprecision(20)<<yard<<" yar"<<"\n";
mil= s/0.621;
cout<< s << " km : " << setprecision(20)<<mil<<" mil"<<"\n";
return;}
main()
{float s;
int pil,jawab;
cout<<"SELAMAT DATANG DI CONVERTER DISTANCES"<<"\n\n";
cout<<"Masukan Pilihan Satuan Anda Sebelum Diubah : "<<"\n";
cout<<"1= Meter/Metres"<<"\n";
cout<<"2= Inci/Inches"<<"\n";
cout<<"3= Kaki/Feet"<<"\n";
cout<<"4= Yar/Yard"<<"\n";
cout<<"5= Mil/Miles"<<"\n";
cout<<"6= Kilometer/Kilometres"<<"\n";
cout<<"Masukan Pilihan Anda : "<<"\n";
cin>>pil;
if (pil==1)
cout<<"Anda Memilih Satuan Meter"<<"\n";
else
if (pil==2)
cout<<"Anda Memilih Satuan Inci"<<"\n";
else
if (pil==3)
cout<<"Anda Memilih Satuan Kaki"<<"\n";
else
if (pil==4)
cout<<"Anda Memilih Satuan Yar"<<"\n";
else
if (pil==5)
cout<<"Anda Memilih Satuan Mil"<<"\n";
else
if (pil==6)
cout<<"Anda Memilih Satuan Km" <<"\n";
cout<<"Sekarang Masukan Angka Yang Anda Inginkan : ";
cin>>s;
if (pil==1)
meter (s);
else
if (pil==2)
inci (s);
else
if (pil==3)
feet (s);
else
if (pil==4)
yard (s);
else
if (pil==5)
mil (s);
else
if (pil==6)
km (s);
getch ();
return 0;}
Post a Comment