示例#1
0
        public static void Main(string[] args)
        {
            Message myMessage = new Message("Hello World!");

            myMessage.Print();

            Message[] messages = new Message[4];
            messages[0] = new Message("Cool Name!");
            messages[1] = new Message("Nice Name!");
            messages[2] = new Message("Awesome Name!");
            messages[3] = new Message("That name is silly!!!!");

            Console.WriteLine("Enter Name: ");
            string name = Console.ReadLine();

            if (name == "Josh")
            {
                messages[0].Print();
            }
            else if (name == "Nick")
            {
                messages[1].Print();
            }
            else if (name == "Max")
            {
                messages[2].Print();
            }
            else
            {
                messages[3].Print();
            }

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Message myMessage = new Message("Hello World - from Message Object");

            myMessage.Print();
            Message[] messages = new Message[4];
            messages[0] = new Message("Chris is a good teacher");
            messages[1] = new Message("Hey Stew");
            messages[2] = new Message("Bap Boop Beep");
            messages[3] = new Message("That is a silly name");
            Console.WriteLine("Please enter your name!");
            string name = Console.ReadLine().ToLower();

            if (name == "chris")
            {
                messages[0].Print();
            }
            else if (name == "kyle")
            {
                messages[1].Print();
            }
            else if (name == "charlie")
            {
                messages[2].Print();
            }
            else
            {
                messages[3].Print();
            }
            Console.ReadLine();
        }
示例#3
0
        public static void Main(string[] args)
        {
            Message myMessage;

            myMessage = new Message("Hello World");
            myMessage.Print();
            Message[] Messages = new Message[4];
            string    name;

            Messages[0] = new Message(" welcome back!");
            Messages[1] = new Message(" beautiful name");

            Messages[2] = new Message(" great name");
            Messages[3] = new Message(" that is a silly name");
            name        = Console.ReadLine();
            switch (name)
            {
            case "YIXIN":
                Messages[0].Print();
                break;

            case "Ethan":
                Messages[1].Print();
                break;

            case "HU":
                Messages[2].Print();
                break;

            default:
                Messages[3].Print();
                break;
            }
            Console.ReadLine();
        }
示例#4
0
        public static void Main(string[] args)
        {
            Message myMessage = new Message ("Hello World");
            myMessage.Print ();

            Message[] messages = new Message[4];
            messages[0] = new Message ("Welcome back oh great creator");
            messages[1] = new Message ("What a lovely name");
            messages[2] = new Message ("Great name");
            messages[3] = new Message ("Thats a silly name, you suck!");

            Console.WriteLine ("Enter your name: ");
            String name = Console.ReadLine ();

            if (name.ToLower () == "sean") {
                messages [0].Print ();
            } else if (name.ToLower () == "willem") {
                messages [1].Print ();
            } else if (name.ToLower () == "jason") {
                messages [2].Print ();
            } else {
                messages [3].Print ();
            }

            Console.ReadLine ();
        }
示例#5
0
        static void Main(string[] args)
        {
            var myMessage = new Message("Hello World - from Message Object!");

            myMessage.Print();

            var messages = new Message[]
            {
                new Message("No. I am your father."),
                new Message("Sounds like a legend!"),
                new Message("Great name"),
                new Message("That's a silly name")
            };

            var name    = Console.ReadLine();
            var lowered = name.ToLower();

            if (lowered == "luke")
            {
                messages[0].Print();
            }
            else if (lowered == "denver")
            {
                messages[1].Print();
            }
            else if (lowered == "afridi")
            {
                messages[2].Print();
            }
            else
            {
                messages[3].Print();
            }
        }
        public static void Main(string[] args)
        {
            Message myMessage;

            Message[] messages;
            String    name;

            messages = new Message[4];

            myMessage = new Message("Hello World!");
            myMessage.Print();



            Console.Write("Enter Name:");

            name = Console.ReadLine();

            messages [0] = new Message(name + " is a bad name");
            messages [1] = new Message(name + "....");
            messages [2] = new Message(name + " is an awesome name");
            messages [3] = new Message(name + " isn't a name");

            if (name.ToLower() == "andrew")
            {
                myMessage = (messages [0]);
                myMessage.Print();
            }
            else if (name.ToLower() == "willem")
            {
                myMessage = (messages [1]);
                myMessage.Print();
            }
            else if (name.ToLower() == "simon")
            {
                myMessage = (messages [2]);
                myMessage.Print();
            }
            else if (name.ToLower() == "asdf")
            {
                myMessage = (messages [3]);
                myMessage.Print();
            }
        }
        public static void Main(string[] args)
        {
            Message myMessage;

            Message[] messages = new Message[4];

            string name;

            while (true)
            {
                messages[0] = new Message("Did you know your name backwards is Milk?");
                messages[1] = new Message("Welcome back oh great educator!");
                messages[2] = new Message("Git Gud");
                messages[3] = new Message("Yeah...We can't be friends");

                Console.WriteLine("Enter name: ");
                name = Console.ReadLine().ToLower();

                switch (name)
                {
                case "klim":
                    messages[0].Print();
                    break;

                case "jimmy":
                    messages[1].Print();
                    break;

                case "danny":
                    messages[2].Print();
                    break;

                default:
                    messages[3].Print();
                    break;
                }

                myMessage = new Message("Hello World - from Message Object");
                myMessage.Print();

                Console.ReadLine();
            }
        }
示例#8
0
        public static void Main(string[] args)
        {
            Message[] messages = new Message[4];
            messages[0] = new Message("Welcome back oh great educator");
            messages[1] = new Message("What a lovely name");
            messages[2] = new Message("Great name");
            messages[3] = new Message("That is a silly name");

            Message myMessage = new Message("Hello World - from Message Object");

            myMessage.Print();

            Console.WriteLine("Enter name:");
            string line = Console.ReadLine();

            if (!string.IsNullOrEmpty(line))
            {
                switch (line)
                {
                case "Josh":
                    messages[0].Print();
                    break;

                case "Jack":
                    messages[1].Print();
                    break;

                case "Mitch":
                    messages[2].Print();
                    break;

                default:
                    messages[3].Print();
                    break;
                }
            }
            else
            {
                Console.WriteLine("If you don't provide a name, I can't work properly!");
            }
        }
示例#9
0
        public static void Main(string[] args)
        {
            Message myMessage;

            myMessage = new Message("Hello World - from Message Object");
            myMessage.Print();

            Message[] Messages = new Message[4];
            Messages [0] = new Message("Welcome back oh great creator!");
            Messages [1] = new Message("何やってんの、このバカアニキ!?");
            Messages [2] = new Message("What am I doing with my life?");
            Messages [3] = new Message("I am Bagu!");


            Console.WriteLine("Enter name: ");
            string name = Console.ReadLine();

            if (name == "Josh")
            {
                Messages [0].Print();
            }
            else if (name == "Junichi")
            {
                Messages [1].Print();
            }
            else if (name == "Kazuki")
            {
                Messages [2].Print();
            }
            else
            {
                Messages [3].Print();
            }

            Console.ReadLine();
        }
示例#10
0
文件: Main.cs 项目: adammw/hit3172
        public static void Main(string[] args)
        {
            Message msg = new Message("Hello World");

            msg.Print();
        }