diff --git a/Program.cs b/Program.cs index 2e2c79f..fbc2cb3 100644 --- a/Program.cs +++ b/Program.cs @@ -20,6 +20,7 @@ class Program { case 0: break; case 1: + Console.WriteLine(Dimensione()); Pausa(); break; case 2: @@ -51,4 +52,28 @@ class Program { Console.WriteLine("Premere un tasto per continuare. . ."); 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; + } } diff --git a/bin/Debug/net9.0/vacanzeEstive_sezione1.dll b/bin/Debug/net9.0/vacanzeEstive_sezione1.dll index 7e324d1..4c3437e 100644 Binary files a/bin/Debug/net9.0/vacanzeEstive_sezione1.dll and b/bin/Debug/net9.0/vacanzeEstive_sezione1.dll differ diff --git a/bin/Debug/net9.0/vacanzeEstive_sezione1.pdb b/bin/Debug/net9.0/vacanzeEstive_sezione1.pdb index 9c3c17c..40d2047 100644 Binary files a/bin/Debug/net9.0/vacanzeEstive_sezione1.pdb and b/bin/Debug/net9.0/vacanzeEstive_sezione1.pdb differ diff --git a/obj/Debug/net9.0/ref/vacanzeEstive_sezione1.dll b/obj/Debug/net9.0/ref/vacanzeEstive_sezione1.dll index ba4e88e..ef91785 100644 Binary files a/obj/Debug/net9.0/ref/vacanzeEstive_sezione1.dll and b/obj/Debug/net9.0/ref/vacanzeEstive_sezione1.dll differ diff --git a/obj/Debug/net9.0/refint/vacanzeEstive_sezione1.dll b/obj/Debug/net9.0/refint/vacanzeEstive_sezione1.dll index ba4e88e..ef91785 100644 Binary files a/obj/Debug/net9.0/refint/vacanzeEstive_sezione1.dll and b/obj/Debug/net9.0/refint/vacanzeEstive_sezione1.dll differ diff --git a/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfo.cs b/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfo.cs index 9404afa..576353f 100644 --- a/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfo.cs +++ b/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfo.cs @@ -13,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("vacanzeEstive_sezione1")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [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.AssemblyTitleAttribute("vacanzeEstive_sezione1")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Generato dalla classe WriteCodeFragment di MSBuild. diff --git a/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfoInputs.cache b/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfoInputs.cache index ff4067a..825bd41 100644 --- a/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/vacanzeEstive_sezione1.AssemblyInfoInputs.cache @@ -1 +1 @@ -49587ec21a533b659168b080272a7c45ac74fe435455f4394a474d41b9a868d7 +1eeb6ff89f5b94b429cb84477f8d11d2ea7cb2cdd0a50be434aa675ca13d0e04 diff --git a/obj/Debug/net9.0/vacanzeEstive_sezione1.dll b/obj/Debug/net9.0/vacanzeEstive_sezione1.dll index 7e324d1..4c3437e 100644 Binary files a/obj/Debug/net9.0/vacanzeEstive_sezione1.dll and b/obj/Debug/net9.0/vacanzeEstive_sezione1.dll differ diff --git a/obj/Debug/net9.0/vacanzeEstive_sezione1.pdb b/obj/Debug/net9.0/vacanzeEstive_sezione1.pdb index 9c3c17c..40d2047 100644 Binary files a/obj/Debug/net9.0/vacanzeEstive_sezione1.pdb and b/obj/Debug/net9.0/vacanzeEstive_sezione1.pdb differ