How do I output the data from the constructor?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
10 views
How to do to display data from the designer, which was introduced earlier?
All displays through the zeros.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Bill { int _ID; double _Balance, Persent; protected int ID { get { return _ID; } set { value = _ID; } } protected double Balance { get { return _Balance; } set { value = _Balance; } } public Bill(int ID, double Balance) { this.ID = ID; this.Balance = Balance; Persent = 0.03; } public void DisplayBill() { Console.WriteLine("An identification number:" + ID); Console.WriteLine("Amount on the bill is:" + Balance); } public override string ToString() { return "Bill number:" + ID + "Balance:" + Balance; } ~Bill() { } } class Depositor : Bill { string _FullName, _Passport; protected string FullName { get { return _FullName; } set { value = _FullName; } } protected string Passport { get { return _Passport; } set { value = _Passport; } } public Depositor(string FullName, string Passport, int ID, double Balance) : base(ID, Balance) { this.FullName = FullName; this.Passport = Passport; } public void DisplayDepositor() { Console.WriteLine("Full name:" + FullName); Console.WriteLine("Your Passport:" + Passport); } public override string ToString() { return "Full Name:" + FullName + "Passport seria/number:" + Passport; } ~Depositor() { } } class BillDepositor : Depositor { double _MaxBill; string _Password; protected double MaxBill { get { return _MaxBill; } set { value = _MaxBill; } } protected string Password { get { return _Password; } set { value = _Password; } } public BillDepositor(string FullName, string Passport, int ID, double Balance, double MaxBill, string Password) : base(FullName, Passport, ID, Balance) { this.MaxBill = MaxBill; this.Password = Password; } public void WithdrawPerHour() { } public void Withdraw() { } public void ChangePassword() { } ~BillDepositor() { } } class Program { static void Main() { BillDepositor BankPerson = new BillDepositor("Alexandr Laketych Milankovich", "TT184675", 1130795, 27000.00, 9999.99, "498sagzba099"); BankPerson.DisplayBill(); BankPerson.DisplayDepositor(); } }
by | 10 views

2 Answers

0 like 0 dislike
You have an error, it is necessary so:
int _ID; protected int ID { get { return _ID; } set { _ID = value; } }

confused
instead of the set { _ID = value; } write set { value = _ID; }
by
0 like 0 dislike
string _FullName, _Passport;

protected string FullName {
get { return _FullName; }
set { _FullName = value; }
}

protected string Passport {
get { return _Passport; }
set { _Passport = value; }
}
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Sep 3, 2019 by zlodiak
0 like 0 dislike
1 answer
asked Aug 7, 2019 by zlodiak
0 like 0 dislike
1 answer
asked Jul 12, 2019 by zlodiak
0 like 0 dislike
1 answer
asked Jul 16, 2019 by zlodiak
110,608 questions
257,186 answers
0 comments
35,404 users