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 };
- //struct Coffee
- //{
- // public string grind;
- // public string Name { get; set; }
- // public string Bean { get; set; }
- // public string CountryOfOrigin { get; set; }
- // public int Strength { get; set; }
- //}
- //Create a constructor in a struct
- //public struct Coffee
- //{
- // // This is the custom constructor.
- // public Coffee(int strength, string bean, string countryOfOrigin)
- // {
- // this.Strength = strength;
- // this.Bean = bean;
- // this.CountryOfOrigin = countryOfOrigin;
- // }
- // // These statements declare the struct fields and set the default values.
- // public int Strength;
- // public string Bean;
- // public string CountryOfOrigin;
- // // Other methods, fields, properties, and events.
- //}
- static void Main(string[] args)
- {
- //Working With Arrays
- //int[] array = new int[10];
- //int[] simple;
- //int[] newArray = { 10, 20, 30, 40 };
- //int[,] twoDArray = { { 3, 2 }, { 4, 1 }, { 5, 5 } };
- //for (int rows = 0; rows < twoDArray.GetLength(0); rows++)
- //{
- // for (int cols = 0; cols < twoDArray.GetLength(1); cols++)
- // {
- // Console.Write(twoDArray[rows, cols]);
- // }
- // Console.WriteLine();
- //}
- ////Working With Enumerations
- //int x = (int)Days.Monday;
- //Console.WriteLine("Monday = {0}", x);
- //int y = (int)Days.Sunday;
- //Console.WriteLine("Sunday = {0}", y);
- ////Output:
- ////0
- ////7
- //Working With Structures
- //Coffee coffee1 = new Coffee();
- //coffee1.Name = "Fourth Coffee Quencher";
- //coffee1.CountryOfOrigin = "Indonesia";
- //coffee1.Strength = 3;
- //coffee1.grind = "Fine";
- //Console.WriteLine("Name {0}", coffee1.Name);
- //Console.WriteLine("Country of Origin {0}", coffee1.CountryOfOrigin);
- //Console.WriteLine("Strength {0}", coffee1.Strength);
- //Console.WriteLine("Grind: {0}", coffee1.grind);
- ////Calling a constructor struct
- //Coffee coffee1 = new Coffee(4, "Arabica", "Colombia");
- //Console.WriteLine(coffee1.CountryOfOrigin);
- ////Colombia
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment