two left
This commit is contained in:
59
labs/lab7_done/MyClass/Program.cs
Normal file
59
labs/lab7_done/MyClass/Program.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
/*
|
||||
Book b1 = new Book();
|
||||
b1.SetBook("Пушкин А.С.", "Капитанская дочка", "Вильямс", 123, 2012);
|
||||
Book.SetPrice(12);
|
||||
b1.Show();
|
||||
Console.WriteLine("\n Итоговая стоимость аренды: {0} р.", b1.PriceBook(3));
|
||||
|
||||
Book b2 = new Book("Толстой Л.Н.", "Война и мир", "Наука и жизнь", 1234, 2013);
|
||||
b2.Show();
|
||||
|
||||
Book b3 = new Book("Лермонтов М.Ю.", "Мцыри");
|
||||
b3.Show();
|
||||
|
||||
|
||||
Triangle t1 = new Triangle(3, 4, 5);
|
||||
t1.Show();
|
||||
Console.WriteLine("perimeter = {0}", t1.Perimeter());
|
||||
Console.WriteLine("area = {0}", t1.Area());
|
||||
Console.WriteLine("does this triangle exist? {0}", t1.Exists());
|
||||
|
||||
Triangle t2 = new Triangle(3, 4, 7);
|
||||
t2.Show();
|
||||
Console.WriteLine("does this triangle exist? {0}", t2.Exists());
|
||||
*/
|
||||
|
||||
// Item item1 = new Item();
|
||||
// item1.Show();
|
||||
|
||||
Book b2 = new Book("Толстой Л. Н.", "Война и мир", "Наука и жизнь", 1234, 2013, 101, true);
|
||||
|
||||
b2.Show();
|
||||
b2.TakeItem();
|
||||
b2.Show();
|
||||
|
||||
|
||||
Magazine mag1 = new Magazine("О природе", 5, "Земля и мы", 2014, 1235, true);
|
||||
mag1.Show();
|
||||
|
||||
Console.WriteLine("\n Тестирование полиформизма");
|
||||
Item it;
|
||||
|
||||
it = b2;
|
||||
it.TakeItem();
|
||||
it.Return();
|
||||
it.Show();
|
||||
|
||||
it = mag1;
|
||||
it.TakeItem();
|
||||
it.Return();
|
||||
it.Show();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user