Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Ingeniería: 15142315
Docente en línea: José Francisco Rico Gallegos
Febrero 2020
1
Introducción
Los elementos principales para analizar la estructura de un programa en C#, son
los tipos de datos, operadores aritméticos, clases, objetos y constructores.
Propósito
Analizar la estructura de un programa en C#, sigue estos pasos:
#include <iostream>
#include <cstdlib>
#include <stdio.h>
int main()
{
double num;
int opt;
system("title Conversor de temperaturas");
cout << |Conversor de temperatura|\n\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;
2
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;
}
}
Referencia bibliográfica.
UnADM. (s.f.). Ceit Obtenido de Unidad_1_Introducción_a_NET: Recuperado de
https://ceit.unadmexico.mx/contenidos/DCEIT/BLOQUE1/DS/05/DPRN1/U1/descar
gables/Unidad%201.%20Introduccion%20a%20.NET.pdf
3
4