Conversor de temperaturas en C++

Iniciado por Jhonjhon_123, Febrero 23, 2010, 07:54:39 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Febrero 23, 2010, 07:54:39 PM Ultima modificación: Febrero 08, 2014, 05:44:22 PM por Expermicid
Bueno, aquí otra practica conversa centigrados, farenhait y kelvin.

Código: cpp
#include <iostream>
#include <cstdlib>
#include <stdio.h>

using namespace std;

int main()
{

/*CodeD by KilerSys
www.internetizados.wordpress.com*/

    double num;
    int opt;
    system("title Conversor de temperaturas");
    cout << "#Coded by KilerSys\n#Conversor de temperaturas v1.0\n#www.internetizados.wordpress.com\n\nConvertir:\n1. Centigrados/Celsius a Farenheit\n2. Farenheit a Centigrados/Celsius\n3. Farenheit a Kelvin\n4. Kelvin a Farenheit\n5. Kelvin a Centigrados/Celsius\n6. Centigrados/Celsius a Kelvin\n0. Salir\n\nOpcion: ";
    cin >> opt;
    if(opt==1){
               cout << "Escribe los Grados Centigrados/Celsius: ";
               cin >> num;
               cout << "\n " << num << " Grados Centigrados/Celsius son " << (num + 32) * 1.8 << " Grados Farenheit." << endl;
               system("pause");
               }
    if(opt==2){
               cout << "Escribe los Grados Farenheit: ";
               cin >> num;
               cout << "\n " << num << " Grados Farenheit son " << (num - 32) / 1.8 << " Grados Centigrados/Celsius." << endl;
               system("pause");
               }
    if(opt==3){
               cout << "Escribe los Grados Farenheit: ";
               cin >> num;
               cout << "\n " << num << " Grados Farenheit son " << (num + 459.67) / 1.8 << " Grados Kelvin." << endl;
               system("pause");
               }
    if(opt==4){
               cout << "Escribe los Grados Kelvin: ";
               cin >> num;
               cout << "\n " << num << " Grados Kelvin son " << (num * 1.8) - 459.67 << " Grados Farenheit." << endl;
               system("pause");
               }
    if(opt==5){
               cout << "Escribe los Grados Kelvin: ";
               cin >> num;
               cout << "\n " << num << " Grados Kelvin son " << (num - 273.16) << " Grados Centigrados." << endl;
               system("pause");
               }
    if(opt==6){
               cout << "Escribe los Grados Centigrados/Celsius: ";
               cin >> num;
               cout << "\n " << num << " Grados Centigrados/Celsius son " << num + 273.16 << " Grados Kelvin." << endl;
               system("pause");
               }
    if(opt==0){
               cout << "Hasta la proxima." << endl;
               system("pause");
               return EXIT_SUCCESS;
}
}


Saludos!
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta