예제 #1
0
 static void Main(string[] args)
 {
     // Method 1 using assignment
     Employee Employee = new Employee(); // creates an instance of Employee
     Employee.Name = "Dave"; //sets name
     Employee.Age = 45; // sets age
     Console.WriteLine("{0}'s age is {1}", Employee.Name, Employee.Age); //display
 }
예제 #2
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();
        }
예제 #3
0
 public void NewHire(Employee applicant)
 {
     EmployeeList.Add(applicant);
 }
예제 #4
0
 static void Main(string[] args)
 {
     Employee Dave = new Employee();
     Dave.Age = 35;
     Console.WriteLine("Dave's age is {0}", Dave.Age);
 }