Rimozione variabili inutili
This commit is contained in:
parent
36801822d8
commit
4110767bb2
22
Program.cs
22
Program.cs
@ -2,20 +2,14 @@
|
||||
namespace Rubrica_Miglioria;
|
||||
|
||||
class Program {
|
||||
static void Main(string[] args) {
|
||||
static void Main() {
|
||||
Console.Clear();
|
||||
const int DIMENSIONE_RUBRICA = 100;
|
||||
int scelta = 0;
|
||||
string nome = "";
|
||||
string numeroditelefono;
|
||||
int scelta;
|
||||
bool rubricaNonVuota = false;
|
||||
bool error;
|
||||
int contatore = 0;
|
||||
string ricerca;
|
||||
string[] nomi = new string[DIMENSIONE_RUBRICA];
|
||||
string[] numeriditelefono = new string[DIMENSIONE_RUBRICA];
|
||||
Voce singolavoce = null;
|
||||
Voce[] voci = new Voce[DIMENSIONE_RUBRICA];
|
||||
Rubrica rubrica = new Rubrica(DIMENSIONE_RUBRICA);
|
||||
do {
|
||||
Console.WriteLine("1)Aggiungi nuova voce in rubrica");
|
||||
@ -30,6 +24,9 @@ class Program {
|
||||
Console.WriteLine($"Limite di {DIMENSIONE_RUBRICA} voci nella rubrica raggiunta");
|
||||
}
|
||||
else {
|
||||
string nome;
|
||||
string numeroditelefono;
|
||||
|
||||
do {
|
||||
string? message;
|
||||
error = true;
|
||||
@ -44,7 +41,7 @@ class Program {
|
||||
else {
|
||||
error = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
while (error);
|
||||
do {
|
||||
@ -52,7 +49,7 @@ class Program {
|
||||
error = true;
|
||||
Console.WriteLine("Inserisci il numero di telefono della voce che andrà nella rubrica telefonica");
|
||||
numeroditelefono = Console.ReadLine();
|
||||
|
||||
|
||||
message = Controllo(numeroditelefono, false, contatore, rubrica);
|
||||
|
||||
if (message != null) {
|
||||
@ -79,7 +76,7 @@ class Program {
|
||||
error = true;
|
||||
Console.WriteLine("Inserisci il nome esatto che stai cercando");
|
||||
ricerca = Console.ReadLine().ToLower();
|
||||
|
||||
|
||||
message = Controllo(ricerca, true, 0, rubrica); //lo zero serve per saltare il controllo per verificare se il nome esiste già o meno
|
||||
|
||||
if (message != null) {
|
||||
@ -104,7 +101,7 @@ class Program {
|
||||
error = true;
|
||||
Console.WriteLine("Inserisci il nome approssimato che stai cercando");
|
||||
ricerca = Console.ReadLine().ToLower();
|
||||
|
||||
|
||||
message = Controllo(ricerca, true, 0, rubrica); //lo zero serve per saltare il controllo per verificare se il nome esiste già o meno
|
||||
|
||||
if (message != null) {
|
||||
@ -178,7 +175,6 @@ class Program {
|
||||
ritorno = $"Questo {(p_tipologia ? "nome" : "numero di telefono")} esiste già nella rubrica.";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return ritorno;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user