Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ModuleThreeAssignment
- {
- class Program
- {
- enum Days { Monday, Thursday, Wednesday, Thuesday, Friday, Saturday, Sunday };
- public struct Menu
- {
- private string[] beverages;
- // This is the indexer.
- public string this[int index]
- {
- get { return this.beverages[index]; }
- set { this.beverages[index] = value; }
- }
- // Enable client code to determine the size of the collection.
- public int Length
- {
- get { return beverages.Length; }
- }
- }
- static void Main(string[] args)
- {
- Menu myMenu = new Menu();
- string firstDrink = myMenu[0];
- int numberOfChoices = myMenu.Length;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment