this is the code:
MainProgram.cs (here is entry point)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TrashManager
{
class MainProgram
{
static void Main(string[] args)
{
Menu meni = new Menu();
meni.Start();
}
}
}
Menu.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TrashManager
{
class Menu
{
public void WriteMenuText()
{
Console.WriteLine("----------------------------------------");
Console.WriteLine("--------------PROGRAM MENU--------------");
Console.WriteLine("----------------------------------------");
Console.WriteLine("Whole Numbers with for : 1");
Console.WriteLine("Floating point Numbers with while : 2");
Console.WriteLine("Currency Converter with Do-While loop: 3");
Console.WriteLine("Waste schedule : 4");
Console.WriteLine("Exit the program : 0");
Console.WriteLine("----------------------------------------");
Console.ReadKey();
}
public int Start()
{
WriteMenuText();
try
{
int a = 5;
while (a != 0)
{
a = Convert.ToInt16(Console.Read());
switch (a)
{
case 1:
Console.WriteLine("Program nije dovršen");
break;
case 2:
Console.WriteLine("Program nije dovršen");
break;
case 3:
Console.WriteLine("Program nije dovršen");
break;
case 4:
Console.WriteLine("Program nije dovršen");
break;
case 0:
default:
Console.WriteLine("Krivi unos...ponovite postupak");
break;
}
}
}
catch (Exception e)
{
Console.WriteLine(e);
Console.ReadKey();
}
return 0;
}
}
}
what I'm getting here is: ImageShack® - Online Photo and Video Hosting
this is confusing me because i have never had any problems with switch


Sign In
Create Account


Back to top









