Fixes
This commit is contained in:
parent
1e60a48eea
commit
93e3321eed
27
Program.cs
27
Program.cs
@ -3,8 +3,8 @@
|
||||
class Program {
|
||||
static void Main(string[] args) {
|
||||
Console.Clear();
|
||||
const int MAX_LIBRI = 10;
|
||||
int scelta, j;
|
||||
const int MAX_LIBRI = 2;
|
||||
int scelta, libroSelezionato = -1;
|
||||
Libro[] biblioteca = new Libro[MAX_LIBRI];
|
||||
bool oggettoEsistente, nomeEsistente, casaEditriceEsistente;
|
||||
string casaEditrice, nome;
|
||||
@ -15,6 +15,7 @@ class Program {
|
||||
Console.WriteLine("2. Mostra biblioteca");
|
||||
Console.WriteLine("3. Mostra libro");
|
||||
Console.WriteLine("4. Applica sconto");
|
||||
Console.WriteLine("5. Pulisci schermo");
|
||||
Console.WriteLine("0. Esci");
|
||||
Console.Write("Scelta: ");
|
||||
scelta = Convert.ToInt32(Console.ReadLine());
|
||||
@ -70,6 +71,7 @@ class Program {
|
||||
}
|
||||
while (scelta < 0 || scelta > biblioteca.Length);
|
||||
biblioteca[scelta].StampaLibro();
|
||||
scelta = int.MaxValue;
|
||||
}
|
||||
Pausa();
|
||||
break;
|
||||
@ -86,16 +88,14 @@ class Program {
|
||||
else {
|
||||
Console.WriteLine("Scegliere un nome:");
|
||||
for (int i = 0; i < biblioteca.Length; i++) {
|
||||
biblioteca[i].GetNome();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"{biblioteca[i].GetNome()}");
|
||||
}
|
||||
Console.Write("Nome: ");
|
||||
nome = Console.ReadLine();
|
||||
|
||||
Console.WriteLine("Scegliere una casa editrice:");
|
||||
for (int i = 0; i < biblioteca.Length; i++) {
|
||||
biblioteca[i].GetCasaEditrice();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine($"{biblioteca[i].GetCasaEditrice()}");
|
||||
}
|
||||
Console.Write("Casa editrice: ");
|
||||
casaEditrice = Console.ReadLine();
|
||||
@ -103,21 +103,24 @@ class Program {
|
||||
nomeEsistente = false;
|
||||
casaEditriceEsistente = false;
|
||||
|
||||
for (j = 0; j < biblioteca.Length && !nomeEsistente && !casaEditriceEsistente; j++) {
|
||||
nomeEsistente = biblioteca[j].GetNome() == nome;
|
||||
casaEditriceEsistente = biblioteca[j].GetCasaEditrice() == casaEditrice;
|
||||
for (int i = 0; i < biblioteca.Length && !nomeEsistente && !casaEditriceEsistente; i++) {
|
||||
nomeEsistente = biblioteca[i].GetNome() == nome;
|
||||
casaEditriceEsistente = biblioteca[i].GetCasaEditrice() == casaEditrice;
|
||||
libroSelezionato = i;
|
||||
}
|
||||
if (!nomeEsistente || !casaEditriceEsistente) {
|
||||
Console.WriteLine($"Nessun libro di nome {nome} di casa editrice {casaEditrice} esistente.");
|
||||
}
|
||||
else {
|
||||
biblioteca[j].ApplicaSconto();
|
||||
biblioteca[libroSelezionato].ApplicaSconto();
|
||||
Console.WriteLine("Sconto applicato.");
|
||||
}
|
||||
|
||||
}
|
||||
Pausa();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
Console.Clear();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Opzione non valida.");
|
||||
Pausa();
|
||||
|
||||
BIN
bin/Debug/net9.0/biblioteca
Executable file
BIN
bin/Debug/net9.0/biblioteca
Executable file
Binary file not shown.
23
bin/Debug/net9.0/biblioteca.deps.json
Normal file
23
bin/Debug/net9.0/biblioteca.deps.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v9.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v9.0": {
|
||||
"biblioteca/1.0.0": {
|
||||
"runtime": {
|
||||
"biblioteca.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"biblioteca/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
bin/Debug/net9.0/biblioteca.dll
Normal file
BIN
bin/Debug/net9.0/biblioteca.dll
Normal file
Binary file not shown.
BIN
bin/Debug/net9.0/biblioteca.pdb
Normal file
BIN
bin/Debug/net9.0/biblioteca.pdb
Normal file
Binary file not shown.
12
bin/Debug/net9.0/biblioteca.runtimeconfig.json
Normal file
12
bin/Debug/net9.0/biblioteca.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.
@ -13,10 +13,10 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("biblioteca")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3a03e615888527814e42096963631995b875d7f7")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1e60a48eea80d0ccf5e6ca758d90fd2a0af06775")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("biblioteca")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("biblioteca")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
// Generato dalla classe WriteCodeFragment di MSBuild.
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
459e7955ba4252a3be22397cd3b5e71c5d58d11d307354d6993334cac373adf2
|
||||
b5871efc6e390aebc571734a0cd23a8997474bde51295597dd89db59d417a58f
|
||||
|
||||
@ -0,0 +1 @@
|
||||
a9f6fd306d1f84e9f310005b7ff2d4f04a3fd42213cb5e1e9be2cd058ed91c91
|
||||
14
obj/Debug/net9.0/biblioteca.csproj.FileListAbsolute.txt
Normal file
14
obj/Debug/net9.0/biblioteca.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,14 @@
|
||||
/home/Verde/git/biblioteca/bin/Debug/net9.0/biblioteca
|
||||
/home/Verde/git/biblioteca/bin/Debug/net9.0/biblioteca.deps.json
|
||||
/home/Verde/git/biblioteca/bin/Debug/net9.0/biblioteca.runtimeconfig.json
|
||||
/home/Verde/git/biblioteca/bin/Debug/net9.0/biblioteca.dll
|
||||
/home/Verde/git/biblioteca/bin/Debug/net9.0/biblioteca.pdb
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.GeneratedMSBuildEditorConfig.editorconfig
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.AssemblyInfoInputs.cache
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.AssemblyInfo.cs
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.csproj.CoreCompileInputs.cache
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.dll
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/refint/biblioteca.dll
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.pdb
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/biblioteca.genruntimeconfig.cache
|
||||
/home/Verde/git/biblioteca/obj/Debug/net9.0/ref/biblioteca.dll
|
||||
BIN
obj/Debug/net9.0/biblioteca.dll
Normal file
BIN
obj/Debug/net9.0/biblioteca.dll
Normal file
Binary file not shown.
1
obj/Debug/net9.0/biblioteca.genruntimeconfig.cache
Normal file
1
obj/Debug/net9.0/biblioteca.genruntimeconfig.cache
Normal file
@ -0,0 +1 @@
|
||||
47110de21d993c562ae89b418c918d0fccbe3ce9a0fe954a85bed6ad0add4480
|
||||
BIN
obj/Debug/net9.0/biblioteca.pdb
Normal file
BIN
obj/Debug/net9.0/biblioteca.pdb
Normal file
Binary file not shown.
BIN
obj/Debug/net9.0/ref/biblioteca.dll
Normal file
BIN
obj/Debug/net9.0/ref/biblioteca.dll
Normal file
Binary file not shown.
BIN
obj/Debug/net9.0/refint/biblioteca.dll
Normal file
BIN
obj/Debug/net9.0/refint/biblioteca.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user