public static void Main()
string[] guestList = {"Rebecca", "Nadia", "Noor", "Jonte"};
string[] rsvps = new string[10];
RSVP("Rebecca", 1, "none", true);
RSVP("Nadia", 2, "Nuts", true);
RSVP("Linh", 2, "none", false);
RSVP("Tony", 1, "Jackfruit", true);
RSVP("Noor", 4, "none", false);
RSVP("Jonte", 2, "Stone fruit", false);
void RSVP(string name, int partySize, string allergies, bool inviteOnly)
foreach (string guest in guestList)
if (guest.Equals(name)) {
Console.WriteLine($"Sorry, {name} is not on the guest list");
rsvps[count] = $"Name: {name}, \tParty Size: {partySize}, \tAllergies: {allergies}";
Console.WriteLine("\nTotal RSVPs:");
for (int i = 0; i < count; i++)
Console.WriteLine(rsvps[i]);