Advertisement
BloodMoonYTC

BankSzmla

Oct 19th, 2021
1,537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Bankszaml
  8. {
  9.     class bankszamla
  10.     {
  11.         double egyenleg;
  12.         public bankszamla(double egyenleg)
  13.         {
  14.             this.egyenleg=egyenleg;
  15.         }
  16.         public double EGYENLEG
  17.         {
  18.             get { return egyenleg; }
  19.         }
  20.         public void noveles(double egyenleg)
  21.         {
  22.             this.egyenleg=+egyenleg;
  23.         }
  24.         public void csokkent (double osszeg)
  25.         {
  26.             if (osszeg>egyenleg)
  27.             {
  28.                 osszeg=-egyenleg;
  29.                 bool true;
  30.             }
  31.             else
  32.             {
  33.                 Console.WriteLine("Nincs eleg penz a szamlan");
  34.             }
  35.         }
  36.     }
  37.     class Program
  38.     {
  39.         static void Main(string[] args)
  40.         {
  41.             double osszeg=1000;
  42.             Console.WriteLine("Bankszamlan levo osszeg 1000");
  43.             bankszamla szamla=new bankszamla(osszeg);
  44.             Console.WriteLine("A szamla egyenlege {0}", szamla.EGYENLEG);
  45.             Console.WriteLine("A bevitt ertek 500 din");
  46.  
  47.             Console.WriteLine("A szamla egyenlege {0}", szamla.EGYENLEG);
  48.         }
  49.     }
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement