//Converts measurements from standard to metric and vice versa //Created by Gilad "Speaker For The Dead" Barlev //Final Programming Edit on 2/11/01 (D/M/Y) //Final Internal Documentation Edit on 13/11/01 (D/M/Y) #include #include using namespace std; int main() {//beginning of main program //intro cout << "Speaker For The Dead Presents..." << endl << endl; getch(); //declare variables int selection = 0.0; float input = 0.0; float output = 0.0; //main menu Main: cout << "Standard <> Metric" << endl << "Conversions" << endl; getch(); cout << endl << "Main Menu" << endl << endl << "(1)Length" << endl << "(2)Area" << endl << "(3)Volume" << endl << "(4)Mass" << endl << "(5)Temperature" << endl << "Enter anything else to quit" << endl << "Enter selection=?"; cin >> selection; if (selection == 1) {//length //length menu cout << endl << "Length" << endl << endl << "(1) in -> cm" << endl << "(2) in <- cm" << endl << "(3) f -> m" << endl << "(4) f <- m" << endl << "(5) mi -> km" << endl << "(6) mi <- km" << endl << "(7) BACK" << endl << "Enter selection=?"; cin >> selection; if (selection == 1) {//in->cm cout << "INCHES TO CENTIMETERS" << endl << endl << "in=?"; cin >> input; output = input / .394; cout << "cm=" << output << endl; return 0; }//end in->cm if (selection == 2) {//in<-cm cout << "CENTIMETERS TO INCHES" << endl << endl << "cm=?"; cin >> input; output = input * .394; cout << "in=" << output << endl; return 0; }//end in<-cm if (selection == 3) {//ft->m cout << "FEET TO METRES" << endl << endl << "ft=?"; cin >> input; output = input / 3.281; cout << "m=" << output << endl; return 0; }//end ft->m if (selection == 4) {//ft<-m cout << "METRES TO FEET" << endl << endl << "m=?"; cin >> input; output = input * 3.281; cout << "ft=" << output << endl; return 0; }//end ft<-m if (selection == 5) {//km<-mi cout << "MILES TO KILOMETERS" << endl << endl << "mi=?"; cin >> input; output = input / .621; cout << "km=" << output << endl; return 0; }//end km<-mi if (selection == 6) {//km->mi cout << "KILOMETERS TO MILES" << endl << endl << "km=?"; cin >> input; output = input * .621; cout << "mi=" << output << endl; return 0; }//end km->mi else {//quit to main menu goto Main; }//end of quit }//end of length if (selection == 2) {//area //area main menu cout << "AREA." << endl << endl << "(1) ft² -> m²" << endl << "(2) ft² <- m²" << endl << "(3) mi² -> km²" << endl << "(4) mi² <- km²" << endl << "(5) acres -> hectacres" << endl << "(6) acres <- hectacres" << endl << "(7) BACK" << endl; cin >> selection; if (selection == 1) {//ft²->m² cout << "SQARE FEET TO SQUARE METERS" << endl << endl << "ft²=?"; cin >> input; output = input / 10.76; cout << "m²=" << output << endl; return 0; }//end ft²->m² if (selection == 2) {//ft²<-m² cout << "SQUARE METERS TO SQUARE FEET" << endl << endl << "m²=?"; cin >> input; output = input * 10.76; cout << "ft²=" << output << endl; return 0; }//end ft²<-m² if (selection == 3) {//mi²->km² cout << "SQUARE MILES TO SQUARE KILOMETERS" << endl << endl << "mi²=?"; cin >> input; output = input / .386; cout << "km²=" << output << endl; return 0; }//end mi²->km² if (selection == 4) {//mi²<-km² cout << "SQUARE KILOMETERS TO SQUARE MILES" << endl << endl << "km²=?"; cin >> input; output = input * .386; cout << "mi²=" << output << endl; return 0; }//end km²->mi² if (selection == 5) {//acres->hectacres cout << "ACRES TO HECTACRES" << endl << endl << "acres=?"; cin >> input; output = input / 2.47; cout << "hectacres=" << output << endl; return 0; }//end acres->hectacres if (selection == 6) {//acres<-hectacres cout << "HECTACRES TO ACRES" << endl << endl << "hectacres=?"; cin >> input; output = input * 2.47; cout << "acres=" << output << endl; return 0; }//end acres<-hectacres else {//quit to main menu goto Main; }//end of quit }//end of area if (selection == 3) {//volume //volume main menu cout << endl << "Volume" << endl << endl << "(1) fl oz -> mL" << endl << "(2) fl oz <- mL" << endl << "(3) gal -> L" << endl << "(4) gal <- L" << endl << "(5) BACK" << endl; cin >> selection; if (selection == 1) {//fl oz->mL cout << "FLUID OUNCES TO MILILITERS" << endl << endl << "fl oz=?"; cin >> input; output = input / .034; cout << "mL=" << output << endl; return 0; }//end fl oz->mL if (selection == 2) {//fl oz<-mL cout << "MILILITERS TO FLUID OUNCES" << endl << endl << "mL=?"; cin >> input; output = input * 3.281; cout << "fl oz=" << output << endl; return 0; }//end fl oz<-mL if (selection == 3) {//gal->L cout << "GALLONS TO LITERS" << endl << endl << "gal=?"; cin >> input; output = input / .264; cout << "L=" << output << endl; return 0; }//end gal->L if (selection == 4) {//gal<-L cout << "LITERS TO GALLONS" << endl << endl << "L=?"; cin >> input; output = input * .264; cout << "gal=" << output << endl; return 0; }//gal<-L else {//quit to main menu goto Main; }//end of quit }//end ofvolume if (selection == 4) {//mass //mass main menu cout << endl << "Mass" << endl << endl << "(1) oz -> g" << endl << "(2) oz <- g" << endl << "(3) lbs -> kg" << endl << "(4) lbs <- kg" << endl << "(5) T -> t" << endl << "(6) T <- t" << endl << "(7) BACK" << endl; cin >> selection; if (selection == 1) {//oz->g cout << "OUNCES TO GRAMS" << endl << endl << "oz=?"; cin >> input; output = input / .035; cout << "g=" << output << endl; return 0; }//end oz->g if (selection == 2) {//oz<-g cout << "GRAMS TO OUNCES" << endl << endl << "g=?"; cin >> input; output = input * .035; cout << "oz=" << output << endl; return 0; }//end oz<-g if (selection == 3) {//lbs->kg cout << "POUNDS TO KILOGRAMS" << endl << endl << "lbs=?"; cin >> input; output = input / 2.205; cout << "kg=" << output << endl; return 0; }//end lbs->kg if (selection == 4) {//lbs<-kg cout << "KILOGRAMS TO POUNDS" << endl << endl << "kg=?"; cin >> input; output = input * 2.205; cout << "lbs=" << output << endl; return 0; }//end lbs<-kg if (selection == 5) {//T->t cout << "TONS TO METRIC TONS" << endl << endl << "T=?"; cin >> input; output = input / 1.102; cout << "t=" << output << endl; return 0; }//end T->t if (selection == 6) {//T<-t cout << "METRIC TONS TO TONS" << endl << endl << "t=?"; cin >> input; output = input * 1.102; cout << "T=" << output << endl; return 0; }//end T<-t else {//quit to main menu goto Main; }//end of quit }//end of mass if (selection == 5) {//temperature cout << endl << "Temperature" << endl << endl << "(1) °F -> °C" << endl << "(2) °F <- °C" << endl << "(3) °F -> °K" << endl << "(4) °F <- °K" << endl << "(5) °C -> °K" << endl << "(6) °C <- °K" << endl << "(7) BACK" << endl; cin >> selection; if (selection == 1) {//°F->°C cout << "DEGREES FARENHEIT TO DEGREES CELSIUS" << endl << endl << "°F=?"; cin >> input; output = (input - 32) * 5/9; cout << "°C=" << output << endl; return 0; }//end °F->°C if (selection == 2) {//°F<-°C cout << "DEGREES CELSIUS TO DEGREES FARENHEIT" << endl << endl << "°C=?"; cin >> input; output = input * (9/5) + 32; cout << "°F=" << output << endl; return 0; }//end °F<-°C if (selection == 3) {//°F->°K cout << "DEGREES FARENHEIT TO DEGREES KELVIN" << endl << endl << "°F=?"; cin >> input; output = (input - 32) * 5/9 + 273.15; cout << "°K=" << output << endl; return 0; }//end °F->°K if (selection == 4) {//°F<-°K cout << "DEGREES KELVIN TO DEGREES FARENHEIT" << endl << endl << "°K=?"; cin >> input; output = input * (9/5) - 241.15; cout << "°F=" << output << endl; return 0; }//end °F<-°K if (selection == 5) {//°C->°K cout << "DEGREES CELSIUS TO DEGREES KELVIN" << endl << endl << "°C=?"; cin >> input; output = input + 273.15; cout << "°K=" << output << endl; return 0; }//end °C->°K if (selection == 6) {//°C<-°K cout << "DEGREES KELVIN TO DEGREES CELSIUS" << endl << endl << "°K=?"; cin >> input; output = input - 273.15; cout << "°C=" << output << endl; return 0; }//end °C<-°K else {//quit to main menu goto Main; }//end of quit }//end of temperature //credits and return function cout << "This program was made by Speaker For The Dead for entertainment purposes only." << endl << "For problems with this program or more information on Speaker For The Dead," << endl<< "Please send an email to the_sftd@yahoo.com" << endl; return 0; }//end of program //This program was made by Speaker For The Dead for entertainment purposes only. //For problems with this program or more information on Speaker For The Dead, //Please send an email to the_sftd@yahoo.com