Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
4
Добавлен:
12.11.2022
Размер:
4.57 Кб
Скачать
using System;
using System.Collections.Generic;

namespace ConsoleApp4Net
{
class Program
{
static void Main()
{
Console.WriteLine("Viberite svoyy dolzhnost`");
Console.WriteLine("1.Logist");
Console.WriteLine("2.Voditel`");
var ml = new MarshrutniyList();
//var dr = new DriverCollection();
var gr = new Gruz();
var vibor = Convert.ToInt32(Console.ReadLine());
switch (vibor){
case 1:
Console.WriteLine("Spisok fynkcii:");
Console.WriteLine("1.Sozdat` marshrut");
Console.WriteLine("2.Dobavit` novogo voditelya ili naznachit` voditelya na zakaz");
Console.WriteLine("3.Dobavit` gruz");
var vibor_l = Convert.ToInt32(Console.ReadLine());
if (vibor_l==1){
ml.Marshrut();
break;
}
//if (vibor_l==2){
//dr.DriverCollection();
//break;
//}
break;
if (vibor_l==3){
gr.SozdGruz();
break;
}
case 2:
Console.WriteLine("Class v razrabotke");
break;
}
}
}

public class Logist
{

void OtpravVoditelya()
{
Console.WriteLine($"Voditel` Driver_Name otpravlen v naznachennyy tochky marshrytnogo lista");
}
void ZaprositMestoVoditelya()
{
Console.WriteLine($"Voditel` Driver_Name seichas ");//здесь будет точка из маршрута и километраж
}
void RazgryzLogist()
{
//вызов метода Razgruz_Driver у водителя
}

}
public class Gruz
{
public string GruzName {get;set;}
public int GruzWeight {get;set;}
public void SozdGruz()
{
Console.WriteLine($"Naimenovanie gruza: ");
var gruzn=Console.ReadLine();
Console.WriteLine($"Massa gruza: ");
var gruzw=Convert.ToInt32(Console.ReadLine());
}
}
public class MarshrutniyList
{
public void Marshrut()
{
int i=0;
Console.WriteLine("Vvedite kolichestvo tochek v marshrute");
i=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Vvodite cherez probel rasstoyanie do sledyyschei tochki, a zatem nazvanie etoi tochki ");
Dictionary <int, string> marshrut = new Dictionary <int, string>();
string marsh_name;
int r;
int kilo=0;
for (int j=0; j < i; j++)
{
Console.WriteLine("Rasstoyanie do sledyyschego pynkta: ");
r = ConvertToInt32(ConsoleReadLine());
Console.Write("Rasstoyanie do sledyyschego pynkta: ");
marsh_name = Console.ReadLine();
marshrut.Add(r, marsh_name);
kilo = kilo+r;
}
Console.WriteLine("Obschii kilometrazh: ");
Console.WriteLine(kilo);
if (kilo>300){
Console.WriteLine("Vnimanie! Voditely bydet neobhodima stoyanka");
}
return;
}
}
/*public class Auto
{
public int MaxGruz{get; set;}
private string Concern{get;}
private int Data{get;}
private int ObiemBaka{get;set;}
private int Rashod{get;set;}
int mesto=0;

public void DvizhAuto()
{
mesto+=1;

if (mesto==i)
{
Console.WriteLine("Avtomobil` pribil v konechnyi pynkt");
}
}
}
/*public void Zapravka()
{
if (bak==0)
{
bak=100;
}

}



}*/

}
Соседние файлы в папке новая папка