Bajt Temat założony przez niniejszego użytkownika |
» 2013-04-24 10:22:00
#include <iostream> #include <Windows.h> #include <cstdlib> #include <conio.h>
using namespace std;
unsigned int dlugosc; unsigned int wybor; unsigned int wybor_jednostki; unsigned int wybor_jednostki1; unsigned int wybor_jednostki2;
unsigned int czas; unsigned int kilometry; unsigned int kilometry_na_milimetry, kilometry_na_centymetry, kilometry_na_decymetry, kilometry_na_metry;
unsigned int miligramy, gramy, dekagramy, kilogramy, tony; long double mili_na_gramy, mili_na_deko, mili_na_kilo, mili_na_tony; long double gramy_na_mili, gramy_na_deko, gramy_na_kilo, gramy_na_tony; long double deko_na_mili, deko_na_gramy, deko_na_kilo, deko_na_tony; long double kilo_na_mili, kilo_na_deko, kilo_na_gramy, kilo_na_tony; long long int tony_na_mili, tony_na_deko, tony_na_kilo, tony_na_gramy;
double milimetry, centymetry, decymetry, metry; float minuty, godziny, dni; double minuty_na_sekundy; float minuty_na_godziny; float godziny_na_sekundy, godziny_na_minuty, godziny_na_dni; float dni_na_sekundy, dni_na_minuty, dni_na_godziny;
double milimetry_na_centymetry, milimetry_na_decymetry, milimetry_na_metry, milimetry_na_kilometry; double centymetry_na_decymetry, centymetry_na_metry, centymetry_na_kilometry; double decymetry_na_metry, decymetry_na_kilometry; int decymetry_na_milimetry, decymetry_na_centymetry, centymetry_na_milimetry; int metry_na_milimetry, metry_na_centymetry, metry_na_decymetry; double metry_na_kilometry;
int dni_na_doby; unsigned int dni1;
int mili_kwadratowe, mili_na_centy, mili_na_metry, mili_na_kilo, mili_na_ary, mili_na_hekto;
char klawisz; char wyjscie;
void WybierzJednostke() { system( "cls" ); system( "color 80" ); cout << "\t\t==================================" << endl << endl; cout << "\a\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\t[1] Czas" << endl << "\t\t-------------------------" << endl << "\t\t[2] Dlugosc" << endl << "\t\t-------------------------" << endl << "\t\t[3] Masa" << endl << "\t\t-------------------------" << endl << "\t\t[4] Powierzchnia" << endl << "\t\t-------------------------" << endl << "\t\t[5] Newtony" << endl << "\t\t-------------------------" << endl << "\t\t[6] Ohmy" << endl << "\t\t-------------------------" << endl << "\t\t[7] Wroc" << endl << endl << endl; cout << "\t\tWybierz jednostke: "; cin >> wybor_jednostki; switch( wybor_jednostki ) { case 1: system( "cls" ); system( "color 8f" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl << "\t\t[1] Minuty" << endl << "\t\t-------------------------" << endl << "\t\t[2] Godziny" << endl << "\t\t-------------------------" << endl << "\t\t[3] Dni" << endl << "\t\t-------------------------" << endl << "\t\t[4] Wroc" << endl << endl << endl; cout << "\t\tWybierz jednostke: "; cin >> czas; switch( czas ) { case 1: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc minut, ktore chcesz skonwertowac: "; cin >> minuty; if( cin.fail() == true ) { cout << "\n\n\t\tPodaj liczbe rzeczywista!" << endl; cout << "\t\tPodaj wartosc minut, ktore chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> minuty; } minuty_na_sekundy = minuty * 60; minuty_na_godziny = minuty / 60; cout << "\n\n\t\t" << minuty << " minuty to: " << endl << endl; cout << "\t\t[1] Sekund " << minuty_na_sekundy << endl << "\t\t-------------------------" << endl << "\t\t[2] Godzin: " << minuty_na_godziny << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 2: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc godzin, ktore chcesz skonwertowac: "; cin >> godziny; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe rzeczywista!" << endl; cout << "\t\tPodaj wartosc godzin, ktore chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> godziny; } godziny_na_sekundy = godziny * 60 * 60; godziny_na_minuty = godziny * 60; godziny_na_dni = godziny / 24; if( godziny == 1 ) { cout << "\n\n\t\t" << godziny << " godzina to: " << endl << endl; } if( godziny == 2 || 3 || 4 ) { cout << "\n\n\t\t" << godziny << " godziny to: " << endl << endl; } else { cout << "\n\n\t\t" << godziny << " godzin to: " << endl << endl; } cout << "\t\t[1] Sekund: " << godziny_na_sekundy << endl << "\t\t-------------------------" << endl << "\t\t[2] Minut: " << godziny_na_minuty << endl << "\t\t-------------------------" << endl << "\t\t[3] Dni: " << godziny_na_dni << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 3: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc dni, ktore chcesz skonwertowac: "; cin >> dni; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe rzeczywista!" << endl; cout << "\t\tPodaj wartosc dni, ktore chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> dni; } dni_na_sekundy = dni * 24 * 3600; dni_na_minuty = dni * 24 * 60; dni_na_godziny = dni * 24 * 1; dni_na_doby = dni * 1; if( dni == 1 ) { cout << "\n\n\t\t" << dni << " dzien to: " << endl << endl; } else { cout << "\n\n\t\t" << dni << " dni to: " << endl << endl; } cout << "\t\t[1] Sekund: " << dni_na_sekundy << endl << "\t\t-------------------------" << endl; Sleep( 2000 ); cout << "\t\t[2] Minut: " << dni_na_minuty << endl << "\t\t-------------------------" << endl << "\t\t[3] Godzin: " << dni_na_godziny << endl << "\t\t-------------------------" << endl << "\t\t[4] Dob: " << dni_na_doby << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 4: break; default: cout << "\n\nPodaj liczbe z Menu!" << endl; } case 2: system( "cls" ); system( "color 8f" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl << "\t\t[1] Milimetry" << endl << "\t\t-------------------------" << endl << "\t\t[2] Centymetry" << endl << "\t\t-------------------------" << endl << "\t\t[3] Decymetry" << endl << "\t\t-------------------------" << endl << "\t\t[4] Metry" << endl << "\t\t-------------------------" << endl << "\t\t[5] Kilometry" << endl << "\t\t-------------------------" << endl << "\t\t[6] Wroc" << endl << endl << endl; cout << "\t\tWybierz jednostke: "; cin >> dlugosc; switch( dlugosc ) { case 1: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc milimetrow, ktora chcesz skonwertowac: "; cin >> milimetry; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\tPodaj wartosc milimetrow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> milimetry; } milimetry_na_centymetry =( milimetry * 0.1 ); milimetry_na_decymetry = milimetry * 0.01; milimetry_na_metry = milimetry * 0.001; milimetry_na_kilometry = milimetry * 0.0001; if( milimetry == 1 ) { cout << "\n\n\t\t" << milimetry << " milimetr to: " << endl << endl; } if( milimetry == 2 || 3 || 4 ) { cout << "\n\n\t\t" << milimetry << " milimetry to: " << endl << endl; } else { cout << "\n\n\t\t" << milimetry << " milimetrow to: " << endl << endl; } cout << "\t\t[1] Centymetrow: " << milimetry_na_centymetry << endl << "\t\t-------------------------" << endl << "\t\t[2] Decymetrow: " << milimetry_na_decymetry << endl << "\t\t-------------------------" << endl << "\t\t[3] Metrow: " << milimetry_na_metry << endl << "\t\t-------------------------" << endl << "\t\t[4] Kilometrow: " << milimetry_na_kilometry << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 2: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc centymetrow, ktora chcesz skonwertowac: "; cin >> centymetry; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\tPodaj wartosc centymetrow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> milimetry; } centymetry_na_milimetry = centymetry * 10; centymetry_na_decymetry = centymetry * 0.1; centymetry_na_metry = centymetry * 0.01; centymetry_na_kilometry = centymetry * 0.001; if( centymetry == 1 ) { cout << "\n\n\t\t" << centymetry << " centymetr to: " << endl << endl; } if( centymetry == 2 || 3 || 4 ) { cout << "\n\n\t\t" << centymetry << " centymetrytry to: " << endl << endl; } else { cout << "\n\n\t\t" << centymetry << " centymetrow to: " << endl << endl; } cout << "\t\t[1] Milimetrow: " << centymetry_na_milimetry << endl << "\t\t-------------------------" << endl << "\t\t[2] Decymetrow: " << centymetry_na_decymetry << endl << "\t\t-------------------------" << endl << "\t\t[3] Metrow: " << centymetry_na_metry << endl << "\t\t-------------------------" << endl << "\t\t[4] Kilometrow: " << centymetry_na_kilometry << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 3: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc decymetrow, ktora chcesz skonwertowac: "; cin >> decymetry; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\tPodaj wartosc decymetrow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> decymetry; } decymetry_na_milimetry = centymetry * 100; decymetry_na_centymetry = centymetry * 10; decymetry_na_metry = centymetry * 0.1; decymetry_na_kilometry = centymetry * 0.01; if( decymetry == 1 ) { cout << "\n\n\t\t" << decymetry << " decymetr to: " << endl << endl; } if( decymetry == 2 || 3 || 4 ) { cout << "\n\n\t\t" << decymetry << " decymetry to: " << endl << endl; } else { cout << "\n\n\t\t" << decymetry << " decymetrow to: " << endl << endl; } cout << "\t\t[1] Milimetrow: " << decymetry_na_milimetry << endl << "\t\t-------------------------" << endl << "\t\t[2] Centymetrow: " << decymetry_na_centymetry << endl << "\t\t-------------------------" << endl << "\t\t[3] Metrow: " << decymetry_na_metry << endl << "\t\t-------------------------" << endl << "\t\t[4] Kilometrow: " << decymetry_na_kilometry << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 4: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc metrow, ktora chcesz skonwertowac: "; cin >> metry; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\tPodaj wartosc metrow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> metry; } metry_na_milimetry = metry * 1000; metry_na_centymetry = metry * 100; metry_na_decymetry = metry * 10; metry_na_kilometry = metry * 0.01; if( metry == 1 ) { cout << "\n\n\t\t" << metry << " metr to: " << endl << endl; } if( metry == 2 || 3 || 4 ) { cout << "\n\n\t\t" << metry << " metry to: " << endl << endl; } else { cout << "\n\n\t\t" << metry << " metrow to: " << endl << endl; } cout << "\t\t[1] Milimetrow: " << metry_na_milimetry << endl << "\t\t-------------------------" << endl << "\t\t[2] Centymetrow: " << metry_na_centymetry << endl << "\t\t-------------------------" << endl << "\t\t[3] Decymetrow: " << metry_na_decymetry << endl << "\t\t-------------------------" << endl << "\t\t[4] Kilometrow: " << metry_na_kilometry << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 5: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc kilometrow, ktora chcesz skonwertowac: "; cin >> kilometry; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\tPodaj wartosc kilometrow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> kilometry; } kilometry_na_milimetry = kilometry * 100000; kilometry_na_centymetry = kilometry * 10000; kilometry_na_decymetry = kilometry * 1000; kilometry_na_metry = kilometry * 100; if( kilometry == 1 ) { cout << "\n\n\t\t" << kilometry << " kilometr to: " << endl << endl; } if( kilometry == 2 || 3 || 4 ) { cout << "\n\n\t\t" << kilometry << " kilometry to: " << endl << endl; } else { cout << "\n\n\t\t" << kilometry << " kilometrow to: " << endl << endl; } cout << "\t\t[1] Milimetrow: " << kilometry_na_milimetry << endl << "\t\t-------------------------" << endl << "\t\t[2] Centymetrow: " << kilometry_na_centymetry << endl << "\t\t-------------------------" << endl << "\t\t[3] Decymetrow: " << kilometry_na_decymetry << endl << "\t\t-------------------------" << endl << "\t\t[4] Metrow: " << kilometry_na_metry << endl << "\t\t-------------------------" << endl << endl << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; } case 3: system( "cls" ); system( "color 87" ); cout << "\t\t==================================" << endl << endl; cout << "\a\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\t[1] Miligramy" << endl << "\t\t-------------------------" << endl << "\t\t[2] Gramy" << endl << "\t\t-------------------------" << endl << "\t\t[3] Dekagramy" << endl << "\t\t-------------------------" << endl << "\t\t[4] Kilogramy" << endl << "\t\t-------------------------" << endl << "\t\t[5] Tony" << endl << "\t\t-------------------------" << endl << "\t\t[6] Wroc" << endl << endl << endl; cout << "\t\tWybierz jednostke: "; cin >> wybor_jednostki1; switch( wybor_jednostki1 ) { case 1: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc miligramow, ktora chcesz skonwertowac: "; cin >> miligramy; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\t\nPodaj wartosc miligramow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> miligramy; } mili_na_gramy = miligramy * 0.1; mili_na_deko = miligramy * 0.0001; mili_na_kilo = miligramy * 0.000001; mili_na_tony = miligramy * 0.000000001; if( miligramy == 1 ) { cout << "\n\n\t\t" << miligramy << " miligram to: " << endl << endl; } if( miligramy == 2 || 3 || 4 ) { cout << "\n\n\t\t" << miligramy << " miligramy to: " << endl << endl; } else { cout << "\n\n\t\t" << miligramy << " miligramow to: " << endl << endl; } cout << "\t\t[1] Gramow: " << mili_na_gramy << endl; cout << "\t\t-------------------------" << endl; cout << "\t\t[2] Dekagramow: " << mili_na_deko << endl; cout << "\t\t-------------------------" << endl; cout << "\t\t[3] Kilogramow: " << mili_na_kilo << endl; cout << "\t\t-------------------------" << endl; cout << "\t\t[4] Tony: " << mili_na_tony << endl; cout << "\t\t-------------------------" << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 2: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc gramow, ktora chcesz skonwertowac: "; cin >> gramy; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\t\nPodaj wartosc gramow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> gramy; } gramy_na_mili = gramy * 1000; gramy_na_deko = gramy * 0.1; gramy_na_kilo = gramy * 0.001; gramy_na_tony = gramy * 0.000001; if( gramy == 1 ) { cout << "\n\n\t\t" << gramy << "gram to: " << endl << endl; } if( gramy == 2 || 3 || 4 ) { cout << "\n\n\t\t" << gramy << " gramy to: " << endl << endl; } else { cout << "\n\n\t\t" << gramy << " gramow to: " << endl << endl; } cout << "\t\t[1] Miligramow: " << gramy_na_mili << endl << "\t\t-------------------------" << endl << "\t\t[2] Dekagramow: " << gramy_na_deko << endl << "\t\t-------------------------" << endl << "\t\t[3] Kilogramow: " << gramy_na_kilo << endl << "\t\t-------------------------" << endl << "\t\t[4] Tony: " << gramy_na_tony << endl << "\t\t-------------------------" << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 3: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc dekagramow, ktora chcesz skonwertowac: "; cin >> dekagramy; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\t\nPodaj wartosc dekagramow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> dekagramy; } deko_na_mili = dekagramy * 10000; deko_na_gramy = dekagramy * 10; deko_na_kilo = dekagramy * 0.01; deko_na_tony = dekagramy * 0.00001; if( dekagramy == 1 ) { cout << "\n\n\t\t" << dekagramy << "dekagram to: " << endl << endl; } if( dekagramy == 2 || 3 || 4 ) { cout << "\n\n\t\t" << dekagramy << "dekagramy to: " << endl << endl; } else { cout << "\n\n\t\t" << dekagramy << "dekagramow to: " << endl << endl; } cout << "\t\t[1] Miligramow: " << deko_na_mili << endl << "\t\t-------------------------" << endl << "\t\t[2] Gramow: " << deko_na_gramy << endl << "\t\t-------------------------" << endl << "\t\t[3] Kilogramow: " << deko_na_kilo << endl << "\t\t-------------------------" << endl << "\t\t[4] Tony: " << deko_na_tony << endl << "\t\t-------------------------" << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 4: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc kilogramow, ktora chcesz skonwertowac: "; cin >> kilogramy; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\t\nPodaj wartosc kilogramow, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> kilogramy; } kilo_na_mili = kilogramy * 1000000; kilo_na_gramy = kilogramy * 1000; kilo_na_deko = kilogramy * 100; kilo_na_tony = kilogramy * 0.001; if( kilogramy == 1 ) { cout << "\n\n\t\t" << kilogramy << "kilogram to: " << endl << endl; } if( kilogramy == 2 || 3 || 4 ) { cout << "\n\n\t\t" << kilogramy << "kilogramy to: " << endl << endl; } else { cout << "\n\n\t\t" << kilogramy << "kilogramow to: " << endl << endl; } cout << "\t\t[1] Miligramow: " << kilo_na_mili << endl << "\t\t-------------------------" << endl << "\t\t[2] Gramow: " << kilo_na_gramy << endl << "\t\t-------------------------" << endl << "\t\t[3] Kilogramow: " << kilo_na_deko << endl << "\t\t-------------------------" << endl << "\t\t[4] Tony: " << kilo_na_tony << endl << "\t\t-------------------------" << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; case 5: system( "cls" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\tPodaj wartosc ton, ktora chcesz skonwertowac: "; cin >> tony; if( cin.fail() == true ) { cout << "\t\t\n\nPodaj liczbe calkowita!" << endl; cout << "\t\t\nPodaj wartosc ton, ktora chcesz skonwertowac: "; cin.clear(); cin.sync(); cin >> tony; } tony_na_mili = tony * 1000000000; tony_na_gramy = tony * 1000000; tony_na_deko = tony * 100000; tony_na_kilo = tony * 1000; if( tony == 1 ) { cout << "\n\n\t\t" << tony << "tona to: " << endl << endl; } if( tony == 2 || 3 || 4 ) { cout << "\n\n\t\t" << tony << "tony to: " << endl << endl; } else { cout << "\n\n\t\t" << tony << "ton to: " << endl << endl; } cout << "\t\t[1] Miligramow: " << tony_na_mili << endl << "\t\t-------------------------" << endl << "\t\t[2] Gramow: " << tony_na_gramy << endl << "\t\t-------------------------" << endl << "\t\t[3] Kilogramow: " << tony_na_deko << endl << "\t\t-------------------------" << endl << "\t\t[4] Tony: " << tony_na_kilo << endl << "\t\t-------------------------" << endl; cout << "\t\t"; system( "PAUSE" ); WybierzJednostke(); break; } case 4: system( "cls" ); system( "color 87" ); cout << "\t\t==================================" << endl << endl; cout << "\a\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\t[1] Milimetry kwadratowe" << endl << "\t\t-------------------------" << endl << "\t\t[2] Centymerty kwadratowe" << endl << "\t\t-------------------------" << endl << "\t\t[3] Metry kwadratowe" << endl << "\t\t-------------------------" << endl << "\t\t[4] Kilometry kwadratowe" << endl << "\t\t-------------------------" << endl << "\t\t[5] Ary" << endl << "\t\t-------------------------" << endl << "\t\t[6] Hektary" << endl << endl << endl << "\t\t-------------------------" << endl << "\t\t[5] Wroc " << endl << "\t\t-------------------------" << endl; cout << "\t\tWybierz jednostke: "; cin >> wybor_jednostki2; switch( wybor_jednostki2 ) { case 1: system( "cls" ); break; } } }
void Autor() { system( "color 07" ); cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\n\n\t\t| Autorem programu jest Kamil Piechura " << endl; cout << "\t\t----------------------" << endl; cout << "\t\t| Data kompilacji: 30-03-13 r. " << endl; cout << "\t\t----------------------" << endl; cout << "\t\t| Wersja programu: v.1 dla DOS " << endl; cout << "\t\t----------------------" << endl; system( "PAUSE" ); }
void Menu() { cout << "\a\t\t==================================" << endl << endl; cout << "\t\t\tKonwerter Jednostek" << endl << endl; cout << "\t\t==================================" << endl << endl; cout << "\t\t[1] Uruchom Konwerter " << endl; cout << "\t\t -------------------------" << endl; cout << "\t\t[2] Autor" << endl; cout << "\t\t -------------------------" << endl; cout << "\t\t[3] Wyjscie" << endl; cout << "\t\t -------------------------" << endl << endl << endl; cout << "\t\tPodaj liczbe: "; cin >> wybor; switch( wybor ) { case 1: WybierzJednostke(); break; case 2: system( "cls" ); Autor(); system( "cls" ); system( "color f0" ); Menu(); break; case 3: exit( 1 ); break; default: cout << "\n\nPodaj liczbe z Menu!" << endl; } }
int main() { system( "color f0" ); system( "title Konwerter Jednostek - user" ); Menu(); system( "PAUSE" ); }
Wiem, że program jest mało czytelny, nie przyłożyłem się do niego. Wiem również że kompilator wywala kilka ostrzeżeń o utracie danych przy rzutowaniu z int na double'a. Program pisany na szybko |