public static double totalAmount=0;
public static int totalItems;
public static void Main()
Console.WriteLine("enter customer name");
string customer=Console.ReadLine();
Console.WriteLine("enter number of items do you want to enter");
totalItems=Convert.ToInt32(Console.ReadLine());
Item[] List=new Item[totalItems];
for(i=0;i<totalItems;i++)
Console.WriteLine("enter item id");
int itemId=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("enter item name");
string itemName=Console.ReadLine();
Console.WriteLine("enter item cost");
double itemCost=Convert.ToDouble(Console.ReadLine());
List[i]= new Item(itemId,itemName,itemCost);
totalAmount=List[i].itemCost+totalAmount;
Console.WriteLine("The items purchased are");
for(i=0;i<totalItems;i++)
Console.WriteLine(List[i].itemId+" "+List[i].itemName+" "+List[i].itemCost);
Console.WriteLine("Hey you have a discount on your purchase" + "\n"+"Purchase greater than 1500 will get 20% discoount"+"\n"+"Purchase greater than 1000 and less than1500 will get 15% discoount"+"\n"+"Purchase less than 1000 will get 5% discoount");
Console.WriteLine("The Discount percentage for you is 20%");
totalAmount=totalAmount-((totalAmount)*(0.20));
Console.WriteLine("TotalAmount:"+totalAmount);
else if( totalAmount>1000)
Console.WriteLine("The Discount percentage for you is 15%");
totalAmount=totalAmount-((totalAmount)*(0.15));
Console.WriteLine("TotalAmount:"+totalAmount);
Console.WriteLine("The Discount percentage for you is 5%");
totalAmount=totalAmount-((totalAmount)*(0.05));
Console.WriteLine("TotalAmount:"+totalAmount);
public Item(int itemId,String itemName,double itemCost)
set { itemName = value; }
set { itemCost = value; }