diff --git a/Program.cs b/Program.cs index fb2e1dd..99ea032 100644 --- a/Program.cs +++ b/Program.cs @@ -3,6 +3,7 @@ class Program { static void Main(string[] args) { Console.Clear(); + Rifornimento[] rifornimentos = CreaBenzinaio(); int scelta = 0; do { @@ -46,4 +47,18 @@ class Program { Console.WriteLine("Premere un tasto per continuare. . ."); Console.ReadKey(); } + + static Rifornimento[] CreaBenzinaio() { + Random r = new(); + int totalePompe = r.Next(30); + int totaleBenzina = r.Next(totalePompe); + Rifornimento[] ritorno = new Rifornimento[totalePompe]; + for (int i = 0; i < totaleBenzina; i++) { + ritorno[i] = new Rifornimento("benzina super", 1.885); + } + for (int i = totaleBenzina; i < totalePompe; i++) { + ritorno[i] = new Rifornimento("gasolio", 1.812); + } + return ritorno; + } } diff --git a/Rifornimento.cs b/Rifornimento.cs index 062d105..148b27e 100644 --- a/Rifornimento.cs +++ b/Rifornimento.cs @@ -2,4 +2,29 @@ namespace vacanzeEstive_benzinaio; class Rifornimento { + string tipoCarburante; + double litriErogatiComplessivi = 0; + double costoComplessivo = 0; + double costoAlLitro; + + public Rifornimento(string p_tipoCarburante, double p_costoAlLitro) { + this.tipoCarburante = p_tipoCarburante; + this.costoAlLitro = p_costoAlLitro; + } + + public double Erogazione() { + Random r = new(); + double ritorno = r.Next(1, 30) + r.NextDouble(); + this.litriErogatiComplessivi += ritorno; + this.costoComplessivo += ritorno * costoAlLitro; + return ritorno; + } + + public double GetLitriErogatiComplessivi() { + return this.litriErogatiComplessivi; + } + + public double GetCostoComplessivo() { + return this.costoComplessivo; + } } \ No newline at end of file diff --git a/bin/Debug/net9.0/vacanzeEstive_benzinaio b/bin/Debug/net9.0/vacanzeEstive_benzinaio new file mode 100755 index 0000000..0313713 Binary files /dev/null and b/bin/Debug/net9.0/vacanzeEstive_benzinaio differ diff --git a/bin/Debug/net9.0/vacanzeEstive_benzinaio.deps.json b/bin/Debug/net9.0/vacanzeEstive_benzinaio.deps.json new file mode 100644 index 0000000..de2f739 --- /dev/null +++ b/bin/Debug/net9.0/vacanzeEstive_benzinaio.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "vacanzeEstive_benzinaio/1.0.0": { + "runtime": { + "vacanzeEstive_benzinaio.dll": {} + } + } + } + }, + "libraries": { + "vacanzeEstive_benzinaio/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/bin/Debug/net9.0/vacanzeEstive_benzinaio.dll b/bin/Debug/net9.0/vacanzeEstive_benzinaio.dll new file mode 100644 index 0000000..c6a1390 Binary files /dev/null and b/bin/Debug/net9.0/vacanzeEstive_benzinaio.dll differ diff --git a/bin/Debug/net9.0/vacanzeEstive_benzinaio.pdb b/bin/Debug/net9.0/vacanzeEstive_benzinaio.pdb new file mode 100644 index 0000000..38268ae Binary files /dev/null and b/bin/Debug/net9.0/vacanzeEstive_benzinaio.pdb differ diff --git a/bin/Debug/net9.0/vacanzeEstive_benzinaio.runtimeconfig.json b/bin/Debug/net9.0/vacanzeEstive_benzinaio.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/bin/Debug/net9.0/vacanzeEstive_benzinaio.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/obj/Debug/net9.0/apphost b/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..0313713 Binary files /dev/null and b/obj/Debug/net9.0/apphost differ diff --git a/obj/Debug/net9.0/ref/vacanzeEstive_benzinaio.dll b/obj/Debug/net9.0/ref/vacanzeEstive_benzinaio.dll new file mode 100644 index 0000000..f2690b3 Binary files /dev/null and b/obj/Debug/net9.0/ref/vacanzeEstive_benzinaio.dll differ diff --git a/obj/Debug/net9.0/refint/vacanzeEstive_benzinaio.dll b/obj/Debug/net9.0/refint/vacanzeEstive_benzinaio.dll new file mode 100644 index 0000000..f2690b3 Binary files /dev/null and b/obj/Debug/net9.0/refint/vacanzeEstive_benzinaio.dll differ diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfo.cs b/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfo.cs index 4f0f55b..140b12f 100644 --- a/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfo.cs +++ b/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("vacanzeEstive_benzinaio")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6e8de21928c5c2a5598c1c8a1b1876246f027796")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+93ab8537036568c5b13e687e9839a4e6f10acbf5")] [assembly: System.Reflection.AssemblyProductAttribute("vacanzeEstive_benzinaio")] [assembly: System.Reflection.AssemblyTitleAttribute("vacanzeEstive_benzinaio")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfoInputs.cache b/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfoInputs.cache index 1eafd6a..a8a37ce 100644 --- a/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfoInputs.cache @@ -1 +1 @@ -8dadb0201ffad05e026907630aef6359b49769eaa863e08b3bb23b7dafb40783 +c81342749c4fd9b126ec8878e8d080e66f2635a2ab27b602a74a94a2dbc7d621 diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.CoreCompileInputs.cache b/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7c03042 --- /dev/null +++ b/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +12f2025528314169592f1f0997193f71aff11bc2b23205a40f82a2aeec1bb5a1 diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.FileListAbsolute.txt b/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..609ba17 --- /dev/null +++ b/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/Verde/git/vacanzeEstive_benzinaio/bin/Debug/net9.0/vacanzeEstive_benzinaio +/home/Verde/git/vacanzeEstive_benzinaio/bin/Debug/net9.0/vacanzeEstive_benzinaio.deps.json +/home/Verde/git/vacanzeEstive_benzinaio/bin/Debug/net9.0/vacanzeEstive_benzinaio.runtimeconfig.json +/home/Verde/git/vacanzeEstive_benzinaio/bin/Debug/net9.0/vacanzeEstive_benzinaio.dll +/home/Verde/git/vacanzeEstive_benzinaio/bin/Debug/net9.0/vacanzeEstive_benzinaio.pdb +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.GeneratedMSBuildEditorConfig.editorconfig +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfoInputs.cache +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.AssemblyInfo.cs +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.csproj.CoreCompileInputs.cache +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.dll +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/refint/vacanzeEstive_benzinaio.dll +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.pdb +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/vacanzeEstive_benzinaio.genruntimeconfig.cache +/home/Verde/git/vacanzeEstive_benzinaio/obj/Debug/net9.0/ref/vacanzeEstive_benzinaio.dll diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.dll b/obj/Debug/net9.0/vacanzeEstive_benzinaio.dll new file mode 100644 index 0000000..c6a1390 Binary files /dev/null and b/obj/Debug/net9.0/vacanzeEstive_benzinaio.dll differ diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.genruntimeconfig.cache b/obj/Debug/net9.0/vacanzeEstive_benzinaio.genruntimeconfig.cache new file mode 100644 index 0000000..2153364 --- /dev/null +++ b/obj/Debug/net9.0/vacanzeEstive_benzinaio.genruntimeconfig.cache @@ -0,0 +1 @@ +5c24c1a078dbd99869d7c4808c2ffe2b6fb1e483acde4d14c8845715f97d0915 diff --git a/obj/Debug/net9.0/vacanzeEstive_benzinaio.pdb b/obj/Debug/net9.0/vacanzeEstive_benzinaio.pdb new file mode 100644 index 0000000..38268ae Binary files /dev/null and b/obj/Debug/net9.0/vacanzeEstive_benzinaio.pdb differ