Está en la página 1de 4

UNIVERSIDAD AUTÓNOMA TOMÁS FRIAS

FACULTAD DE CIENCIAS PURAS

INGENIERIA INFORMÁTICA

PRÁCTICA

DOCENTE : Lic. Roberto Ramos


MATERIA : Laboratorio de Fisica II
ESTUDIANTE : Luis Miguel Agudo Olguín
FECHA ENTREGA : 25 de noviembre de 2019
Potosí – Bolivia
SOFTWARE PARA LA CONVERSIÓN DE UNIDADES DE TEMPERATURA
°C,°F,°K,°R
Código fuente de la aplicación desarrollada en Lenguaje de
Programación C++
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <stdio.h>
using namespace std;
int main()
{
float num;
int opcion;
do {
cout << "UNIVERSIDAD AUTONOMA TOMAS FRIAS\nFACULTAD DE
CIENCIA PURAS\nINGENIERIA INFORMATICA\n\nCONVERSOR DE
UNIDADES DE TEMPERATURA\n\nElija una unidad a
convertir:\n1. Centigrados\n2. Farenheit\n3. Kelvin\n4.
Rankine\n0. Salir\n\nOpcion: ";
cin >> opcion;

if (opcion == 1)
{
cout << "Ingrese los Grados Centigrados: ";
cin >> num;
cout << num << " Grados Centigrados son " << (num *
1.8) + 32 << " Grados Farenheit " << endl;
cout << num << " Grados Centigrados son " << num +
273.15 << " Grados Kelvin " << endl;
cout << num << " Grados Centigrados son " << (num *
1.8) + 491.67 << " Grados Rankine " << endl;
system("pause");
printf("\n");
}
if (opcion == 2)
{
cout << "Ingrese los Grados Farenheit: ";
cin >> num;
cout << num << " Grados Farenheit son " << (num -
32)/1.8 << " Grados Centigrados " << endl;
cout << num << " Grados Farenheit son " << (num -
32)/1.8 + 273.15 << " Grados Kelvin " << endl;
cout << num << " Grados Farenheit son " << num +
459.67 << " Grados Rankine " << endl;
system("pause");
printf("\n");
}
if (opcion == 3)
{
cout << "Ingrese los Grados Kelvin: ";
cin >> num;
cout << num << " Grados Kelvin son " << num - 273.15
<< " Grados Centigrados " << endl;
cout << num << " Grados Kelvin son " << (num -
273.15)*1.8+32 << " Grados Farenheit " << endl;
cout << num << " Grados Kelvin son " << num * 1.8
<< " Grados Rankine " << endl;
system("pause");
printf("\n");
}
if (opcion == 4)
{
cout << "Ingrese los Grados Rankine: ";
cin >> num;
cout << num << " Grados Rankine son " << (num -
491.67)/1.8 << " Grados Centigrados " << endl;
cout << num << " Grados Rankine son " << num -459.67
<< " Grados Farenheit " << endl;
cout << num << " Grados Rankine son " << num /1.8
<< " Grados Kelvin " << endl;
system("pause");
printf ("\n");
}
if (opcion == 0)
{
return EXIT_SUCCESS;
}
} while (opcion = !0);
getchar();
return 0;
}
FIG.1 PANTALLA EN CONSOLA PRINCIPAL

FIG.2 EJECUNTADO EL CODIGO

También podría gustarte