Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Acc number e unic (incrementat automat incepand cu 123)
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace SuportLaborator7
- {
- public enum AccountType { Cec, Deposit }
- public class BankAccount
- {
- private AccountType accType;
- private long accNumber;
- private decimal amount;
- private static long succNrCont=122;
- public void PopulareCampuri(decimal sold, AccountType tip)
- {
- accType = tip;
- accNumber = NextNumber();
- amount = sold;
- }
- public long NumarCont()
- {
- return accNumber;
- }
- public decimal Sold()
- {
- return amount;
- }
- public AccountType ReturnTipCont()
- {
- return accType;
- }
- static private long NextNumber()
- {
- succNrCont++;
- return succNrCont;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- BankAccount account = new BankAccount();
- BankAccount obj = new BankAccount();
- //long x = long.Parse(Console.ReadLine());
- //while (obj.NumarCont() <= 150)
- //{
- obj.PopulareCampuri(3.5M, AccountType.Deposit);
- Console.WriteLine("Contul meu are numarul {0}, este de tip {1} si are o suma de {2}",
- obj.NumarCont(), obj.ReturnTipCont(), obj.Sold());
- //}
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment