Secondo elemento del menù funzionante
This commit is contained in:
parent
cc5900be0d
commit
8d7b26661d
18
Program.cs
18
Program.cs
@ -7,7 +7,9 @@ class Program
|
||||
|
||||
uint scelta;
|
||||
double celsius, fahrenheit;
|
||||
int numero, quadrato;
|
||||
bool exit=false;
|
||||
|
||||
Console.Clear();
|
||||
do{
|
||||
Console.WriteLine("Scegliere un'opzione:");
|
||||
@ -22,7 +24,8 @@ class Program
|
||||
|
||||
switch (scelta){
|
||||
case 1:
|
||||
Console.WriteLine("Inserire la temperatura in gradi: ");
|
||||
Console.Clear();
|
||||
Console.Write("Inserire la temperatura in gradi: ");
|
||||
celsius=Convert.ToDouble(Console.ReadLine());
|
||||
fahrenheit=ConvertiCelsiusFahrenheit(celsius);
|
||||
Console.WriteLine("La temperatura di " +celsius + "°C corrisponde a " +fahrenheit +"°F");
|
||||
@ -31,8 +34,18 @@ class Program
|
||||
Console.Clear();
|
||||
break;
|
||||
case 2:
|
||||
Console.Clear();
|
||||
Console.Write("Inserire un numero: ");
|
||||
numero=Convert.ToInt32(Console.ReadLine());
|
||||
quadrato=CalcolaQuadrato(numero);
|
||||
Console.WriteLine("Il quadrato di " +numero + " è " +quadrato);
|
||||
Console.WriteLine("Premere invio per continuare . . .");
|
||||
Console.ReadLine();
|
||||
Console.Clear();
|
||||
break;
|
||||
case 3:
|
||||
Console.Clear();
|
||||
|
||||
break;
|
||||
case 4:
|
||||
break;
|
||||
@ -56,4 +69,7 @@ class Program
|
||||
const int costante2=32;
|
||||
return (p_celsius*costante1)+costante2;
|
||||
}
|
||||
static int CalcolaQuadrato(int p_numero){
|
||||
return p_numero*p_numero;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("miscellanea")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8baeddc8b14f77a4f5a70bacb8a3f12cf0d542d1")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cc5900be0d2e03e61bbb8cd7a905845300a7224d")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("miscellanea")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("miscellanea")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
46958ac0e036f846ab4ddb414c93d65cfdfc1d91125982bda4f99345623b367e
|
||||
cd37d2e07e8e322e1e0b99a560dcb280de39c0c917143775811e224e8e743af7
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user