Monty D
2009-12-20 08:35:09 UTC
using System;
class a10
{
static void Main(string[] args)
{
string com;
int c=0;
string[] make=new string[20];
string[] model=new string[20];
int[] year=new int[20];
int[] salesprice=new int[20];
Console.WriteLine("Welcome to Mullet Joe's Gently Used Autos!");
Console.WriteLine("enter comand");
Console.WriteLine("add");
Console.WriteLine("list");
Console.WriteLine("quit");
com=Convert.ToString(Console.ReadLine());
asd:
{
switch(com)
{
case "add":
Console.Write("make ");
make[c]=Convert.ToString(Console.ReadLine());
Console.Write("model ");
model[c]=Convert.ToString(Console.ReadLine());
Console.Write("year ");
year[c]=Convert.ToInt32(Console.ReadLine());
Console.Write("sales price ($) ");
salesprice[c]=Convert.ToInt32(Console.ReadLine());
c++;
goto next;
case "list":
for(int a=0;a
goto next;
case "quit":
break;
default:
Console.WriteLine("Sorry, but"+ com +"is not a valid command. Please try again.");
goto next;
next :
{
Console.WriteLine("enter comand");
Console.WriteLine("add");
Console.WriteLine("list");
Console.WriteLine("quit");
com=Convert.ToString(Console.ReadLine());
goto asd;
}
}
}
}
}
whenever i enter quit option my enter data was automatically delete
i want this program connect to sql server for to save that data