Funzione inserimento dati
This commit is contained in:
25
Program.cs
25
Program.cs
@@ -20,6 +20,7 @@ class Program {
|
|||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
Console.WriteLine(Dimensione());
|
||||||
Pausa();
|
Pausa();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -51,4 +52,28 @@ class Program {
|
|||||||
Console.WriteLine("Premere un tasto per continuare. . .");
|
Console.WriteLine("Premere un tasto per continuare. . .");
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint Dimensione() { //restituisce un intero che indica la dimensione di un lato della figura
|
||||||
|
uint ritorno = 0;
|
||||||
|
bool showErrorMessage;
|
||||||
|
do {
|
||||||
|
showErrorMessage = false;
|
||||||
|
Console.Write("Inserire la dimensione della figura: ");
|
||||||
|
|
||||||
|
try {
|
||||||
|
ritorno = Convert.ToUInt32(Console.ReadLine());
|
||||||
|
if (ritorno == 0) {
|
||||||
|
showErrorMessage = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception) {
|
||||||
|
showErrorMessage = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showErrorMessage) {
|
||||||
|
Console.WriteLine("Errore: inserire un numero superiore a 0.");
|
||||||
|
}
|
||||||
|
} while (showErrorMessage);
|
||||||
|
return ritorno;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,10 +13,10 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("vacanzeEstive_sezione1")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("vacanzeEstive_sezione1")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+67884601db5ef8eca4495227d86e17ae02f2b374")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+482655570f3eafb925e3891c71b8ca439a2f21de")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("vacanzeEstive_sezione1")]
|
[assembly: System.Reflection.AssemblyProductAttribute("vacanzeEstive_sezione1")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("vacanzeEstive_sezione1")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("vacanzeEstive_sezione1")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
// Generated by the MSBuild WriteCodeFragment class.
|
// Generato dalla classe WriteCodeFragment di MSBuild.
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
49587ec21a533b659168b080272a7c45ac74fe435455f4394a474d41b9a868d7
|
1eeb6ff89f5b94b429cb84477f8d11d2ea7cb2cdd0a50be434aa675ca13d0e04
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user