Conversor (Grados Celsius - Fahrenheit - Kelvin) [ESP-ENG] | C++

avatar
(Edited)

cover.JPG

¡Saludos! Acá les traigo más C++, en esta ocasión un conversor de grados Celsius a Fahrenheit y Kelvin.

Comencé con las librerías ya mencionadas, es decir, para entrada y salida, para la sentencia getch y para la limpieza de pantalla. Añadí dos funciones, cada una con un algoritmo simple que será retornado en base a la variable ingresada en su parámetro (k). Estos algoritmos están basados en las fórmulas necesarias para cada conversión.

Luego en el main se declara una variable double "cels" para recibir el valor en grados celsius y trabajarlo y "opc" para el selector y la condición de while. Se recibe el valor en grados celsius y luego muestra las opciones del selector.

Greetings! Here I bring you more C++, this time a Celsius to Fahrenheit and Kelvin converter.

I started with the libraries already mentioned, that is, for input and output, for the getch statement and for screen clearing. I added two functions, each with a simple algorithm that will be returned based on the variable entered in its parameter (k). These algorithms are based on the formulas needed for each conversion.

Then in the main a double variable "cels" is declared to receive the value in degrees Celsius and work it and "opc" for the selector and the while condition. It receives the value in degrees Celsius and then displays the selector options.

image.png

image.png

Programación c++.png

En el caso 1 solo convierte a grados Kelvin, 2 a Fahrenheit, 3
ambos y 4 para salir. Cada uno con su respectivo mensaje explicativo y una llamada a las funciones antes nombradas respectivamente, de modo que según retorne sean mostradas en pantalla.

La variable incluida en los parámetros es obviamente "cels" pues es la que recibe el valor que será convertido.

In case 1 only converts to Kelvin, 2 to Fahrenheit, 3 to both and 4 to exit. Each one with its respective explanatory message and a call to the above mentioned functions respectively, so that as it returns they are displayed on the screen.

The variable included in the parameters is obviously "cels" because it is the one that receives the value to be converted.


image.png

Programación c++.png

image.png

image.png

¡Y bueno... Eso es todo por hoy! Espero que este conversor te sea útil. En la onceava entrega hay uno muy parecido, a partir del cuál recicle parte del selector, por ello quizás encuentres cierta similitud.

Si te interesa otro tutorial de programación acá te dejo los links a los que he realizado hasta ahora:

And well... That's all for today! I hope you find this converter useful. In the eleventh installment there is a very similar one, from which I recycle part of the selector, so maybe you will find some similarity.

If you are interested in another programming tutorial here are the links to the ones I have done until now:


Nombre de la publicación / Name of the postLINK
Calculador de datos para un triángulo rectángulo en C++1
Concecionario de autos, ejercicio en JAVA2
Calculador de edad básico C++3
Inversor de números de tres cifras4
¿Cuántos números de 3 cifras existen cuya suma sea 10? - ¡Respondiendo a otro usuario! C++6
Calculadora simple, cifra menos significativa y portada simple C++7
¡Vistazo a BeatUDO! [ESP-ENG] JAVA9
Comprobar si un número de dos cifras es primo C++10
Conversor de pulgadas a 7 unidades distintas C++11
Comprobar si un número es capicúa (Máx 5 cifras) C++12
Comprobador de caracteres C++13
Calculadora de índice de masa corporal C++14
Calculadora de factoriales C++15

Programación c++.png

Puedes seguirme por acá si lo deseas:
You can follow me here if you want:

Diseño sin título.gif

Cuenta secundaria
(Dibujos, edición y juegos) | Secondary account (Drawings, editing and games)



0
0
0.000
1 comments