Creazione pompe
This commit is contained in:
parent
93ab853703
commit
66abb93ec7
15
Program.cs
15
Program.cs
@ -3,6 +3,7 @@
|
|||||||
class Program {
|
class Program {
|
||||||
static void Main(string[] args) {
|
static void Main(string[] args) {
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
|
Rifornimento[] rifornimentos = CreaBenzinaio();
|
||||||
int scelta = 0;
|
int scelta = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -46,4 +47,18 @@ class Program {
|
|||||||
Console.WriteLine("Premere un tasto per continuare. . .");
|
Console.WriteLine("Premere un tasto per continuare. . .");
|
||||||
Console.ReadKey();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,4 +2,29 @@ namespace vacanzeEstive_benzinaio;
|
|||||||
|
|
||||||
class Rifornimento {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BIN
bin/Debug/net9.0/vacanzeEstive_benzinaio
Executable file
BIN
bin/Debug/net9.0/vacanzeEstive_benzinaio
Executable file
Binary file not shown.
23
bin/Debug/net9.0/vacanzeEstive_benzinaio.deps.json
Normal file
23
bin/Debug/net9.0/vacanzeEstive_benzinaio.deps.json
Normal file
@ -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": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
bin/Debug/net9.0/vacanzeEstive_benzinaio.dll
Normal file
BIN
bin/Debug/net9.0/vacanzeEstive_benzinaio.dll
Normal file
Binary file not shown.
BIN
bin/Debug/net9.0/vacanzeEstive_benzinaio.pdb
Normal file
BIN
bin/Debug/net9.0/vacanzeEstive_benzinaio.pdb
Normal file
Binary file not shown.
12
bin/Debug/net9.0/vacanzeEstive_benzinaio.runtimeconfig.json
Normal file
12
bin/Debug/net9.0/vacanzeEstive_benzinaio.runtimeconfig.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net9.0",
|
||||||
|
"framework": {
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "9.0.0"
|
||||||
|
},
|
||||||
|
"configProperties": {
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
obj/Debug/net9.0/apphost
Executable file
BIN
obj/Debug/net9.0/apphost
Executable file
Binary file not shown.
BIN
obj/Debug/net9.0/ref/vacanzeEstive_benzinaio.dll
Normal file
BIN
obj/Debug/net9.0/ref/vacanzeEstive_benzinaio.dll
Normal file
Binary file not shown.
BIN
obj/Debug/net9.0/refint/vacanzeEstive_benzinaio.dll
Normal file
BIN
obj/Debug/net9.0/refint/vacanzeEstive_benzinaio.dll
Normal file
Binary file not shown.
@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("vacanzeEstive_benzinaio")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("vacanzeEstive_benzinaio")]
|
||||||
[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+6e8de21928c5c2a5598c1c8a1b1876246f027796")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+93ab8537036568c5b13e687e9839a4e6f10acbf5")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("vacanzeEstive_benzinaio")]
|
[assembly: System.Reflection.AssemblyProductAttribute("vacanzeEstive_benzinaio")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("vacanzeEstive_benzinaio")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("vacanzeEstive_benzinaio")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
8dadb0201ffad05e026907630aef6359b49769eaa863e08b3bb23b7dafb40783
|
c81342749c4fd9b126ec8878e8d080e66f2635a2ab27b602a74a94a2dbc7d621
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
12f2025528314169592f1f0997193f71aff11bc2b23205a40f82a2aeec1bb5a1
|
||||||
@ -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
|
||||||
BIN
obj/Debug/net9.0/vacanzeEstive_benzinaio.dll
Normal file
BIN
obj/Debug/net9.0/vacanzeEstive_benzinaio.dll
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
5c24c1a078dbd99869d7c4808c2ffe2b6fb1e483acde4d14c8845715f97d0915
|
||||||
BIN
obj/Debug/net9.0/vacanzeEstive_benzinaio.pdb
Normal file
BIN
obj/Debug/net9.0/vacanzeEstive_benzinaio.pdb
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user