-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
89 lines (82 loc) · 3.06 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
namespace Method
{
class Program
{
private string period;
private double saldoIncome;
private double saldoOutcome;
private double nachisleno;
private double pereraschet;
private double itogoNachisleno;
private double oplacheno;
public void tablica(string period, double saldoIncome, double nachisleno, double pereraschet, double oplacheno)
{
this.period = period;
this.saldoIncome = saldoIncome;
this.nachisleno = nachisleno;
this.pereraschet = pereraschet;
this.itogoNachisleno = nachisleno + pereraschet;
this.oplacheno = oplacheno;
this.saldoOutcome = saldoIncome + itogoNachisleno - oplacheno;
}
private int roomNumber;
private double roomSquare;
public void account(int roomNumber, double roomSquare)
{
this.roomNumber = roomNumber;
this.roomSquare = roomSquare;
}
public string printAccount()
{
return
String.Format(
"Номер комнаты - {0} | - Площадь комнаты - {1}",
roomNumber, roomSquare
);
}
private int tarifNumber;
private string tarifStart;
public void tarif(int tarifNumber, string tarifStart)
{
this.tarifNumber = tarifNumber;
this.tarifStart = tarifStart;
}
public string printTarif()
{
return
String.Format(
"Номер тарифа - {0} |Дата старта тарифа - {1}",
tarifNumber, tarifStart
);
}
public string vedomost()
{
return
String.Format(
"Период - {0} | Сальдо входящее - {1} | Начислено - {2} | Перерасчет - {3} | Итого начислено - {4}| Оплачено - {5}| Сальдо исходящее - {6}|",
period, saldoIncome, nachisleno, pereraschet, itogoNachisleno, oplacheno, saldoOutcome
);
}
static void Main(string[] args)
{
Program p1 = new Program();
string per = "May 2024";
p1.tablica(per, 1300, 750, 0, 650);
string otchet = p1.vedomost();
Console.WriteLine(otchet);
string nextper = "June 2024";
p1.tablica(nextper, 1400, 650, -100, 650);
string nextRow = p1.vedomost();
Console.WriteLine(nextRow);
//string t = p1.tarif(777, per);
p1.account(3978, 10000);
//Console.WriteLine(t[1]);
p1.tarif(777, per);
string printT = p1.printTarif();
Console.WriteLine(printT);
string printA = p1.printAccount();
Console.WriteLine(printA);
}
}
}