コード例 #1
0
        public void DisplayAllPosts()
        {
            NetworkApp app04 = new NetworkApp();

            for (int i = 0; i < 10; i++)
            {
                MessagePost testMessagePost = new MessagePost(author, message);

                testMessagePost.Message = message;

                app04.news.AddMessagePost(testMessagePost);

                PhotoPost testPhotoPost = new PhotoPost(author, fileName, caption);

                testPhotoPost.Filename = fileName;
                testPhotoPost.Caption  = caption;

                app04.news.AddPhotoPost(testPhotoPost);
            }

            app04.ExitLoop = true;
            app04.LoopDisplay();

            for (int i = 0; i < app04.news.Posts.Count; i++)
            {
                app04.news.ShowNextPost();
            }

            Assert.IsTrue(app04.news.VisiblePost == 20);
        }
コード例 #2
0
        public static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.Black;
            Console.Clear();
            NetworkApp game = new NetworkApp();

            game.DisplayMenu();
        }
コード例 #3
0
        public static void Main(string[] args)
        {
            while (true)
            {
                //Creating an object of the distance converter
                DistanceConverter converter = new DistanceConverter();

                //Creating an object of the BMI calculator
                BMI bmi = new BMI();

                //Creating an object of the student grades
                StudentGrades grades = new StudentGrades();

                NetworkApp app04 = new NetworkApp();

                Console.ForegroundColor = ConsoleColor.Yellow;

                ConsoleHelper.OutputHeading("BNU CO453 Applications Programming 2020-2021!\n");

                string[] choices = { "Distance Converter", "BMI Calculator", "Student Grades", "Social Network", "Quit" };

                int choiceNo = ConsoleHelper.SelectChoice(choices);

                /**
                 * Uses if statements and a while loop and list of strings to allow user to
                 * decide on which application they wish to use based upon their inputted number
                 * 1-4
                 * 5 Is a Quit choice which will break the loop and end the application
                 */

                if (choiceNo == 1)
                {
                    converter.ConvertingDistance();
                }

                else if (choiceNo == 2)
                {
                    bmi.BMICalculator();
                }

                else if (choiceNo == 3)
                {
                    grades.ChooseMethod();
                }
                else if (choiceNo == 4)
                {
                    app04.DisplayMenu();
                }
                else if (choiceNo == 5)
                {
                    break;
                }
                else
                {
                    Console.WriteLine("\nYou have entered an invalid choice");
                }
            }
        }
コード例 #4
0
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("BNU CO453 Applications Programming 2020-2021!");
            Console.WriteLine();
            Console.Beep();

            DistanceConverter converter  = new DistanceConverter();
            BMI_Calculator    calculator = new BMI_Calculator();
            StudentGrades     grades     = new StudentGrades();
            NetworkApp        app        = new NetworkApp();

            // Ask the user which app they want to use

            string[] choices = new string[]
            {
                "App01 Distance Converter",
                "App02 BMI Calculator",
                "App03 Student Grades",
                "App04 Social Network"
            };

            int choiceNo = ConsoleHelper.SelectChoice(choices);

            if (choiceNo == 1)
            {
                converter.Run();
            }

            else if (choiceNo == 2)
            {
                calculator.OutputBmi();
            }

            else if (choiceNo == 3)
            {
                grades.UserSelect();
            }

            else if (choiceNo == 4)
            {
                app.DisplayMenu();
            }

            else
            {
                Console.WriteLine("Invalid choice");
            }
        }
コード例 #5
0
        public void AddMessage()
        {
            // Arrange
            NetworkApp App04 = new NetworkApp();

            MessagePost post = new MessagePost("Warren", "Cats are the Best. :D");

            post.Display();

            // Act
            string expectedMessage = "Cats are the Best. :D";

            // Assert
            Assert.AreEqual(expectedMessage, post.Message);
        }
コード例 #6
0
        ///<summary>
        ///  Method shows the selection of applications and allows people to choose what application to use.
        ///</summary>
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("BNU CO453 Application Programming 2020-2021");
            Console.WriteLine();
            Console.Beep();
            DistanceConverter converter    = new DistanceConverter();
            BMICalculator     calculator   = new BMICalculator();
            StudentMarks      studentMarks = new StudentMarks();
            NetworkApp        networkApp   = new NetworkApp();

            while (true)
            {
                Console.WriteLine("Select a program:");
                Console.WriteLine("1. Distance Converter");
                Console.WriteLine("2. BMI Calculator");
                Console.WriteLine("3. Student Grades");
                Console.WriteLine("4. Network");
                Console.WriteLine("5. Mono Game");
                Console.WriteLine("0. Quit");

                string value  = Console.ReadLine();
                int    choice = Convert.ToInt32(value);

                if (choice == 1)
                {
                    converter.run();
                }
                else if (choice == 2)
                {
                    calculator.run();
                }
                else if (choice == 3)
                {
                    studentMarks.run();
                }
                else if (choice == 4)
                {
                    networkApp.run();
                }
                else
                {
                    break;
                }
            }
        }
コード例 #7
0
        public static void Main(string[] args)
        {
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.White;

            Console.WriteLine("BNU CO453 Applications Programming Jan start");
            Console.WriteLine("Evan Castro");
            Console.WriteLine();

            string[] choices = new string[]
            {
                "Distance Coverter",
                "BMI Calculator",
                "Student Grades",
                "Social Network",
                "RSP Game"
            };

            ConsoleHelper.OutputTitle("Please select the application you wish to use ");
            choice = ConsoleHelper.SelectChoice(choices);

            if (choice == 1)
            {
                DistanceConverter converter = new DistanceConverter();
                converter.Run();
            }
            else if (choice == 2)
            {
                BMICalculator calculator = new BMICalculator();
                calculator.Run();
            }
            else if (choice == 3)
            {
                StudentGrades grades = new StudentGrades();
                grades.Run();
            }
            else if (choice == 4)
            {
                NetworkApp App04 = new NetworkApp();
                App04.DisplayMenu();
            }
            else if (choice == 5)
            {
                RPSGame game = new RPSGame();
                game.Run();
            }
        }
コード例 #8
0
        public static void Main(string[] args)
        {
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.White;

            Console.WriteLine("BNU CO453 Applications Programming 2020-2021!");
            Console.WriteLine("Isabelle Thorpe");
            Console.WriteLine();

            string[] choices = new string[]
            {
                "Distance Coverter",
                "BMI Calculator",
                "Student Grades",
                "Network App"
            };

            ConsoleHelper.OutputTitle("Please select the application you wish to use ");
            choice = ConsoleHelper.SelectChoice(choices);

            if (choice == 1)
            {
                DistanceConverter converter = new DistanceConverter();
                converter.Run();
            }
            else if (choice == 2)
            {
                BMI_Calculator calculator = new BMI_Calculator();
                calculator.Run();
            }
            else if (choice == 3)
            {
                StudentGrades studentGrades = new StudentGrades();
                studentGrades.Run();
            }
            else if (choice == 4)
            {
                NetworkApp network = new NetworkApp();
                network.Run();
            }
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: NicholasDay1992/CO453_S2
        public static void Main(string[] args)
        {
            //Console.ForegroundColor = ConsoleColor.Yellow;

            ConsoleHelper.OutputHeading("BNU CO453 Applications Programming 2020-2021!");
            Console.WriteLine();

            //ConsoleHelper.OutputHeading("\tBMI Caclulator\n\tNick Day");
            //ConsoleHelper.OutputIntroduction("Insert BMI introduction here...");

            /*
             * BMI calculator = new BMI();
             * calculator.OutputUnits();
             * calculator.GetUnit();
             * calculator.GetWeight();
             * calculator.GetHeight();
             * calculator.CalculateBMI();
             * calculator.OutputResult();
             */

            NetworkApp news = new NetworkApp();
        }
コード例 #10
0
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Blue;

            ConsoleHelper.OutputHeading("CO453 C# Programming - MAIN MENU", 0.2);
            string[] choices =
            {
                "APP01: Distance Converter",
                "APP02: BMI Calculator",
                "APP03: Student Grades System",
                "APP04: Social Network"
            };
            int choice = ConsoleHelper.SelectChoice(choices);

            if (choice == 1)
            {
                DistanceConverter converter = new DistanceConverter();
                converter.ConvertDistance();
            }
            if (choice == 2)
            {
                BMI bmi = new BMI();
                bmi.MainMenu();
            }
            if (choice == 3)
            {
                StudentGrades studentGrades = new StudentGrades();
                studentGrades.OutputHeading();
            }
            if (choice == 4)
            {
                NetworkApp networkApp = new NetworkApp();
                networkApp.DisplayMenu();
            }
            else
            {
                Console.WriteLine("Please make your choice");
            }
        }
コード例 #11
0
        public static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("BNU CO453 Applications Programming 2020-2021!");
            Console.WriteLine();

            Console.WriteLine();
            Console.WriteLine($" 1. App01 Distance Converter");
            Console.WriteLine($" 2. App02 BMI");
            Console.WriteLine($" 3. App03 Student Grades");
            Console.WriteLine($" 4. App04 Social Network");

            Console.Write("Please select an app > ");
            string choice = Console.ReadLine();


            if (choice.Equals("1"))
            {
                DistanceConverter converter = new DistanceConverter();
                converter.CalculatetoDistance();
            }
            else if (choice == "2")
            {
                BMI bmi = new BMI();
                bmi.Run();
            }
            else if (choice.Equals("3"))
            {
                StudentGrades studentGrades = new StudentGrades();
                studentGrades.Run();
            }
            else if (choice.Equals("4"))
            {
                NetworkApp app04 = new NetworkApp();
                app04.DisplayMenu();
            }
        }
コード例 #12
0
        public static void Main()
        {
            Console.ForegroundColor = ConsoleColor.Yellow;

            ConsoleHelper.OutputHeading("BNU CO453 Applications Programming 2020-2021!");

            string[] choices  = { "Distance Converter", "BMI Calculator", "Student Marks", "Social Network" };
            int      choiceNo = ConsoleHelper.SelectChoice(choices);

            switch (choiceNo)
            {
            case 1:
                DistanceConverter converter = new DistanceConverter();
                converter.ConvertDistance();
                break;

            case 2:
                BMI bmiindex = new BMI();
                bmiindex.ConvertBmi();
                break;

            case 3:
                StudentGrades studentGrades = new StudentGrades();
                studentGrades.StudentMenu();
                break;

            case 4:
                NetworkApp socialApp = new NetworkApp();
                socialApp.DisplayMenu();
                break;

            default:
                Console.WriteLine("Invalid Choice!");
                break;
            }
        }