Struttura base
This commit is contained in:
51
Program.cs
51
Program.cs
@@ -1,9 +1,50 @@
|
||||
namespace vacanzeEstive_rubricaTelefonica;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
class Program {
|
||||
static void Main(string[] args) {
|
||||
Console.Clear();
|
||||
int scelta = 0;
|
||||
|
||||
do {
|
||||
Console.WriteLine("Inserire un'opzione:");
|
||||
Console.WriteLine("1. Aggiungi nuova voce in rubrica");
|
||||
Console.WriteLine("2. Ricerca esatta per nome");
|
||||
Console.WriteLine("3. Ricerca approssimata per nome");
|
||||
Console.WriteLine("4. Visualizza rubrica completa");
|
||||
Console.WriteLine("0. Esci");
|
||||
Console.Write("Scelta: ");
|
||||
|
||||
try {
|
||||
scelta = Convert.ToInt32(Console.ReadLine());
|
||||
|
||||
switch (scelta) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
Pausa();
|
||||
break;
|
||||
case 2:
|
||||
Pausa();
|
||||
break;
|
||||
case 3:
|
||||
Pausa();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Opzione non valida.");
|
||||
Pausa();
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (FormatException) {
|
||||
Console.WriteLine("Opzione non valida.");
|
||||
Pausa();
|
||||
}
|
||||
}
|
||||
while (scelta != 0);
|
||||
}
|
||||
|
||||
static void Pausa() {
|
||||
Console.WriteLine("Premere un tasto per continuare. . .");
|
||||
Console.ReadKey();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user