Added float support
This commit is contained in:
parent
fc321dd06f
commit
34e73a7ef7
11
Program.cs
11
Program.cs
@ -1,10 +1,14 @@
|
|||||||
// See https://aka.ms/new-console-template for more information
|
// 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: ");
|
Console.Write("Inserire il voto: ");
|
||||||
voto=Convert.ToInt32(Console.ReadLine());
|
voto=Convert.ToDouble(Console.ReadLine());
|
||||||
if(voto<0 || voto>ottimo){
|
if(voto<0 || voto>ottimo){
|
||||||
Console.WriteLine("Il voto inserito non è valido.");
|
Console.WriteLine("Il voto inserito non è valido.");
|
||||||
}
|
}
|
||||||
|
else if (voto<sufficiente){
|
||||||
|
Console.WriteLine("il voto è insufficiente.");
|
||||||
|
}
|
||||||
else if (voto>=sufficiente && voto<buono){
|
else if (voto>=sufficiente && voto<buono){
|
||||||
Console.WriteLine("Il voto è sufficiente.");
|
Console.WriteLine("Il voto è sufficiente.");
|
||||||
}
|
}
|
||||||
@ -17,6 +21,3 @@ else if (voto==distinto){
|
|||||||
else if (voto==ottimo){
|
else if (voto==ottimo){
|
||||||
Console.WriteLine("Il voto è ottimo.");
|
Console.WriteLine("Il voto è ottimo.");
|
||||||
}
|
}
|
||||||
else if (voto<sufficiente){
|
|
||||||
Console.WriteLine("il voto è insufficiente.");
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user