From e6799a5f84d6db3c0f017d3a3ebb89fc87d498ce Mon Sep 17 00:00:00 2001 From: hadisfrg Date: Fri, 12 Jun 2026 11:53:42 -0700 Subject: [PATCH] impelementation of homework2 --- homework2.Task2/homework2.Task2.slnx | 3 ++ homework2.Task2/homework2.Task2/Class1.cs | 47 +++++++++++++++++++ homework2.Task2/homework2.Task2/Program.cs | 10 ++++ .../homework2.Task2/homework2.Task2.csproj | 10 ++++ 4 files changed, 70 insertions(+) create mode 100644 homework2.Task2/homework2.Task2.slnx create mode 100644 homework2.Task2/homework2.Task2/Class1.cs create mode 100644 homework2.Task2/homework2.Task2/Program.cs create mode 100644 homework2.Task2/homework2.Task2/homework2.Task2.csproj diff --git a/homework2.Task2/homework2.Task2.slnx b/homework2.Task2/homework2.Task2.slnx new file mode 100644 index 0000000..7aafc80 --- /dev/null +++ b/homework2.Task2/homework2.Task2.slnx @@ -0,0 +1,3 @@ + + + diff --git a/homework2.Task2/homework2.Task2/Class1.cs b/homework2.Task2/homework2.Task2/Class1.cs new file mode 100644 index 0000000..8cb6e9e --- /dev/null +++ b/homework2.Task2/homework2.Task2/Class1.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Design; +using System.Runtime.InteropServices; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace homework2.Task2 +{ + internal class BankAccount + { + private int balance; + public BankAccount(int balance) + + { + balance = balance; + } + public void deposit (double amount) + { + balance +=(int) amount; + } + public void withdraw (double amount) + { + if (amount <= balance) + balance -= (int)amount; + + else + + Console.WriteLine("موجودی کافی نیست "); + + Public void showbalance() + { + Console.WriteLine("balance"); + } + Class program + { + static void Main() + bankaccount = new BankAccount(1000); + + } + + + + + } + } +} diff --git a/homework2.Task2/homework2.Task2/Program.cs b/homework2.Task2/homework2.Task2/Program.cs new file mode 100644 index 0000000..f58b34b --- /dev/null +++ b/homework2.Task2/homework2.Task2/Program.cs @@ -0,0 +1,10 @@ +namespace homework2.Task2 +{ + internal class Program + { + static void Main(string[] args) + { + + } + } +} diff --git a/homework2.Task2/homework2.Task2/homework2.Task2.csproj b/homework2.Task2/homework2.Task2/homework2.Task2.csproj new file mode 100644 index 0000000..ed9781c --- /dev/null +++ b/homework2.Task2/homework2.Task2/homework2.Task2.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + +