Exemple #1
0
        static void Main(string[] args)
        {
            //Task1
            Address addressdefault = new Address();
            Address address = new Address() { Apartment = 110 , City = "Kiev", Country = "Ukraine", House = 50 , Index = 58000, Street = "Hreshatik"};
            Address addressChangedIndex = new Address(10000);

            addressdefault.DisplayAddress();
            address.DisplayAddress();
            Console.WriteLine(addressChangedIndex.ToString());
               //Task 2
            string str = "";
            double number1 = 0;
            double number2 = 0;

            number1 = str.CheckDoubleDigits();
            number2 = str.CheckDoubleDigits();

            Rectangle rectangle = new Rectangle(number1, number2);
            Console.WriteLine(rectangle.ToString());

            //Task 3
            Book book = new Book("Programming","Troelsen","C#");
            book.Show();
            Console.ResetColor();
            //Task 4
            Point A = new Point(1, 2);
            Point B = new Point(2, 1);
            Point C = new Point(3, 2);

            Figure figure = new Figure(A, B, C);
            figure.Display();

            //Task 5
            User user = new User(login:"******", password: "******", name: "Jack", sername:"...");
            user.Output();

            //Task 6
            Converter conv = new Converter(24.6081, 25.99,0.3274);
            conv.Sum = 10.11;
            conv.ChooseCurrency();
            conv.ExchangeCurrency();

            //Task 7

            Employee employee = new Employee("User", "Relly");
            employee.Display();

            //Task 8

            Invoice invoice = new Invoice(10000, "Customer" ,"Provider");
            invoice.Article = "PC";
            invoice.Quantity = 2;
            invoice.Display();

            Console.ReadLine();
            Console.ReadLine();
        }
Exemple #2
0
 static void Main(string[] args)
 {
     Console.Write("Enter rectangle's side1: ");
     double side1 = Double.Parse(Console.ReadLine());
     Console.Write("\nEnter rectangle's side2: ");
     double side2 = Double.Parse(Console.ReadLine());
     Console.WriteLine();
     Rectangle rect = new Rectangle(side1, side2);
     Console.Write("Area: {0}", rect.Area);
     Console.WriteLine("\nPerimeter: {0}", rect.Perimeter);
     Console.ReadKey();
 }