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;
- namespace SuportLaborator7
- {
- public enum AccountType { Cec, Deposit }
- public class BankAccount
- {
- private AccountType accType;
- private long accNumber;
- private decimal amount;
- public void PopulareCampuri(long nr, decimal sold, AccountType tip)
- {
- accType = tip;
- accNumber = nr;
- amount = sold;
- }
- public long NumarCont()
- {
- return accNumber;
- }
- public decimal Sold()
- {
- return amount;
- }
- public AccountType ReturnTipCont()
- {
- return accType;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- BankAccount account = new BankAccount();
- /*account.accType = AccountType.Cec;
- account.amount = 0.8M;
- Console.WriteLine("Introduceti numarul de cont: ");
- account.accNumber = long.Parse(Console.ReadLine());
- */
- BankAccount obj = new BankAccount();
- long x = long.Parse(Console.ReadLine());
- obj.PopulareCampuri(x, 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