Exemplo n.º 1
0
        public static void BuyTickets()
        {
            UserLib.WriteTitle("Buy Tickets");

            group = UserLib.GetString("Enter the name of the group > ");
            date  = UserLib.GetString("Enter the Date > ");

            numberofTickets = UserLib.GetInt("Enter Number of tickets > ");
            ticketCost      = UserLib.GetDecimal("Enter price of ticket > ");

            Console.Clear();
            Console.Write("Bucks New University");
            Console.SetCursorPosition(40, 0);
            Console.Write(date);

            Console.SetCursorPosition(20, 4);
            Console.Write(group);

            Console.SetCursorPosition(0, 8);
            Console.Write("No of Tickets:" + numberofTickets);

            Console.SetCursorPosition(30, 8);
            Console.Write("Cost Per Ticket:" + ticketCost);

            totalCost = totalCost * numberofTickets;

            Console.SetCursorPosition(20, 12);
            Console.Write("Total Cost:" + totalCost.ToString("c"));
        }
Exemplo n.º 2
0
        public static void Calculate()
        {
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.Yellow;

            UserLib.WriteTitle("Salary Calculator");

            weeklySalary = UserLib.GetDecimal("Enter your weekly Salary (£) > ");

            monthlySalary = weeklySalary * 4;
            annualSalary  = monthlySalary * 12;

            Console.WriteLine();
            Console.WriteLine("Weekly  Salary = " + weeklySalary.ToString("£###.00"));
            Console.WriteLine("Monthly Salary = " + monthlySalary.ToString("£###.00"));
            Console.WriteLine("Annual  Salary = " + annualSalary.ToString("c"));
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            //RunUnit1();
            //RunUnit2();

            //RunMeals();
            //RunDice();
            //Dice.Throw(1000);

            //T45_Craps.Play();
            //Console.ReadKey();

            UserLib.WriteTitle("Here is the title");
            string fred = "My Title";

            UserLib.WriteTitle(fred);
        }