jueves, 21 de noviembre de 2019

EXAMEN DE CONVERSIONES:

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
using namespace std;

using namespace std;

int main()
{
    int opcion;
    do {
        system("cls");
        cout << "*****MENU DE OPCIONES*****" << endl;
        cout << "*1. Longitud             *"<< endl;
        cout << "*2. Informacion          *" << endl;
        cout << "*3. Capacidad            *" << endl;
        cout << "*4. SALIR                *" << endl;
        cout << "**************************" << endl<<endl;
        cout<<  "**************************" <<endl;
        cout << "Ingrese una opcion:      *       ";cin >> opcion;
        cout<<  "**************************" <<endl<<endl;
       
        switch (opcion) {
            case 1:
            int m;
        cout<<  "**CONVERSION DE METROS****"<<endl;
        cout<<  "*                        *"<<endl;
        cout<<  "*Ingresa los metros que deseas convertir:"<<endl;
                cin>> m;
        cout<<  "*La conversion a KILOMETROS es:"<<m/1000<<endl;
        cout<<  "*La conversion a CENTIMETROS es:"<<m*100<<endl;
        cout<<  "*La conversion a MILIMETROS es:"<<m*1000<<endl;
        cout<<  "*La conversion a PIES es:"<<m*3.28<<endl;
        cout<<  "*                        *"<<endl;
        cout<<  "**************************" <<endl<<endl;
               
                system("pause>nul");
                break;
               
            case 2:
           float b;
        cout<<  "**CONVERSION DE BYTES****"<<endl;
        cout<<  "*                        *"<<endl;       
        cout<<  "*ingresa los bytes que deseas convertir:"<<endl;
        cout<<  "*";    cin>> b;
        cout<<  "*La conversion a KILOBYTES es:"<<b/1024<<endl;
        cout<<  "*La conversion a MEGABYTES es:"<<((b/1024)/1024)<<endl;
        cout<<  "*La conversion a GIGABYTES es:"<<(((b/1024)/1024)/1024)<<endl;
        cout<<  "*                        *"<<endl;
        cout<<  "**************************" <<endl<<endl;
                system("pause>nul");
                break;
               
            case 3:
            int l;
        cout<<  "**CONVERSION DE LITROS****"<<endl;
        cout<<  "*                        *"<<endl; 
        cout<<  "*Ingresa los litros que deseas convertir:"<<endl;
        cout<<  "*";cin>> l;
        cout<<  "*La conversion a CENTIMETROS CUBICOS es:"<<l*100<<endl;
        cout<<  "*La conversion a DECIMETROS CUBICOS es:"<<l/1<<endl;
        cout<<  "*La conversion a METRO CUBICO es:"<<l/1000<<endl;
        cout<<  "*                        *"<<endl;
        cout<<  "**************************" <<endl<<endl;
                system("pause>nul");           
                break;
        }       
    } while (opcion != 4); 
    return 0;
}

No hay comentarios.:

Publicar un comentario