From 34e73a7ef7505e2d256b4f6abf4adf08d5fa04a6 Mon Sep 17 00:00:00 2001 From: La Programmatrice Verde Date: Wed, 23 Oct 2024 09:42:57 +0200 Subject: [PATCH] Added float support --- Program.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Program.cs b/Program.cs index 698c37e..733f223 100644 --- a/Program.cs +++ b/Program.cs @@ -1,10 +1,14 @@ // See https://aka.ms/new-console-template for more information -int voto, sufficiente=6, buono=8, distinto=9, ottimo=10; +int sufficiente=6, buono=8, distinto=9, ottimo=10; +double voto; Console.Write("Inserire il voto: "); -voto=Convert.ToInt32(Console.ReadLine()); +voto=Convert.ToDouble(Console.ReadLine()); if(voto<0 || voto>ottimo){ Console.WriteLine("Il voto inserito non è valido."); } +else if (voto=sufficiente && voto