CONSOLA
VISUAL
PSEUDOCODIGO
Inicio
string opcion
double grados = 0, celsius = 0, fahrenheit =0, kelvin =0, rankine =0
do
Clear
Print "\n\tOpciones de conversión de temperatura"
Print "\n\ta) Convertir grados Fahrenheit"
Print "\n\tb) Convertir grados Celsius"
Print "\n\tc) Convertir grados Kelvin"
Print "\n\td) Convertir grados Rankine"
Print "\n\tf) Salida"
Print "\n\tElija la opción: "
Read opcion
switch (opcion)
{
case "A":
case "a":
Clear
Print "\n\tConversión de temperatura en grados Fahrenheit"
Print "\n\tIntroduzca cantidad de grados Fahrenheit: "
Read grados
celsius =(5.0/9.0)*(grados-32.00)
kelvin=celsius+273
rankine=grados+460
Print "\n\tGrados Celsius= {0:f2}",celsius
Print "\n\tGrados Kelvin= {0:f2}",kelvin
Print "\n\tGrados Rankine= {0:f2}",rankine
break
case "B":
case "b":
Clear
Print "\n\tConversión de temperatura en grados Celsius"
Print "\n\tIntroduzca cantidad de grados Celsius: "
Read grados
fahrenheit = (9.0 / 5.0) * (grados + 32.00)
kelvin = grados + 273
rankine = fahrenheit + 460
Print "\n\tGrados Fahrenheit= {0:f2}", fahrenheit
Print "\n\tGrados Kelvin= {0:f2}", kelvin
Print "\n\tGrados Rankine= {0:f2}", rankine
break
case "C":
case "c":
Clear
Print "\n\tConversión de temperatura en grados Kelvin"
Console.Write("\n\tIntroduzca cantidad de grados Kelvin: "
Read grados
celsius = grados-273
fahrenheit= (9.0/5.0)*(celsius+32.00)
rankine = fahrenheit + 460
Print "\n\tGrados Celsius= {0:f2}", celsius
Print "\n\tGrados Fahrenheit= {0:f2}", fahrenheit
Print "\n\tGrados Rankine= {0:f2}", rankine
break
case "D":
case "d":
Clear
Print "\n\tConversión de temperatura en grados Rankine"
Print "\n\tIntroduzca cantidad de grados Rankine: "
Read grados
fahrenheit = grados - 460
celsius = (5.0 / 9.0) * (fahrenheit - 32.0)
kelvin = celsius + 273
Print "\n\tGrados Celsius= {0:f2}", celsius
Print "\n\tGrados Kelvin= {0:f2}", kelvin
Console.WriteLine("\n\tGrados Farenheit= {0:f2}", fahrenheit
break
case "F":
case "f":
Print "\n\tFin de programa"
break
default:
Print "\n\tPresionó opción equivocada"
break
}
}
while (opcion != "f" && opcion != "F")
Fin







No hay comentarios:
Publicar un comentario