Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class AVTO
- {
- // Поля класса
- public string gosnomer, model, color, FIO;
- // Метод, выводящий в консоль контактную информацию
- public void writeInConsoleInfo(string gosnomer, string model, string color, string FIO)
- {
- Console.WriteLine("Госномер: {0}\nМодель: {1}\nЦвет: {2}\nФИО: {3}\n",gosnomer , model, color,FIO);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- AVTO myAVTO = new AVTO();
- myAVTO.gosnomer = "С224МН";
- myAVTO.model = "LADA 2114";
- myAVTO.color = "silver";
- myAVTO.FIO = "Камалов И.И";
- AVTO hisAVTO = new AVTO();
- hisAVTO.gosnomer = "Н125УТ";
- hisAVTO.model = "LADA 2110";
- hisAVTO.color = "black";
- hisAVTO.FIO = "Сабитов А.М.";
- myAVTO.writeInConsoleInfo(myAVTO.gosnomer,myAVTO.model,myAVTO.color,myAVTO.FIO);
- hisAVTO.writeInConsoleInfo(hisAVTO.gosnomer, hisAVTO.model, hisAVTO.color, hisAVTO.FIO);
- Console.ReadLine();
- }
- }
- }
- namespace Лабораторная_работа__0_2_
- {
- class Book
- {
- private string Author;
- private string Name;
- private string Izdat;
- private int KolvoStr;
- private int Year;
- private static double price = 9;
- public void Method(string Author, string Name, string Izdat, int KolvoStr, int Year)
- {
- this.Author = Author;
- this.Name = Name;
- this.Izdat = Izdat;
- this.KolvoStr = KolvoStr;
- this.Year = Year;
- }
- public static void SetPrice(double price)
- {
- Book.price = price;
- }
- public void Writelnb()
- {
- Console.WriteLine("\nАвтор: {0}\nНазвание: {1}\nГод издания: { 2}\n {3} стр. \nСтоимость аренды: {4} ", Author, Name, Year, KolvoStr, Book.price);
- }
- public double PriceBook(int s)
- {
- double cust = s * price;
- return cust;
- }
- class Program
- {
- static void Main(string[] args)
- {
- Book b = new Book();
- b.Method("A.S. Pushkin", "Kapitanskaya dochka", "Williams", 123, 2012);
- Book.SetPrice(12);
- b.Writelnb();
- Console.WriteLine("\n Итоговая стоимость аренды: {0} p.", b.PriceBook(3));
- Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement