using static System.Console;
namespace PROGRAMMINGAssign7.EC
public static void Main(string[] args)
int itemN = DisplayGreeting();
string[] iName = new string[itemN];
string[] iRating = new string[itemN];
int[] iPrice = new int[itemN];
for (int i = 0; i < itemN; i++)
ItemValues(i, out iName[i], out iRating[i], out iPrice[i]);
WriteLine("What do you want to do next?");
Console.WriteLine("Enter 1 to display a particular individual item's information and Enter 2 to be told "
+ "which items are in stock");
int option = int.Parse(ReadLine());
DisplayItem(iName, iRating, iPrice);
currentStock = InStock(iPrice);
Console.WriteLine("This item has " + currentStock + " left ");
Console.WriteLine("A valid entry was not entered into the system properly.");
Console.WriteLine("\n\nWould you like to do another transaction?");
while (ans == "Yes" || ans == "yes");
Console.WriteLine("\n\n Thank you for your time and using the InstaShop App!");
public static int DisplayGreeting()
Console.WriteLine("Welcome to the InstaShop App!");
Console.WriteLine("You will be asked to enter the grocery item info" +
" name of the item,the price, what's in stock and your rating");
Console.WriteLine("Then you will have a choice to display all grocery items in the catalog" +
" info or see how much is in stock of the item. ");
Console.WriteLine("\n\n How many grocery items will you enter");
return int.Parse(ReadLine());
public static void ItemValues(int cN, out string iName, out string iRating, out int iPrice)
Console.WriteLine("\nEnter the grocery item name: ");
Console.WriteLine("\nHow much did you spend on the grocery item? {0} ?");
iPrice = int.Parse(ReadLine());
Console.WriteLine("On a scale of 1-10 how satisified are you with your purchase? {0}?");
public static int InStock(int[] iPrice)
return itemStock / iPrice.Length;
public static void DisplayItem(string[] iName, string[] iRating, int[] iPrice)
Console.WriteLine("What grocery items do you want us to display? Enter it's name: ");
string valueIn = ReadLine();
for (int i = 0; i < iRating.Length; i++)
if (valueIn == iRating[i])
Console.WriteLine("Your InstaShop App info: ");
Console.WriteLine("Name:" + iName[n]);
Console.WriteLine("Price: " + iPrice[n]);
Console.WriteLine("Rating; " + iRating[n]);