بله ممنون ميشم چك كنيد ...كلي ارور ميده...خوووو من تازه دالم ياااد ميگيرمممم
usingSystem;
usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;
namespaceConsoleApplication5
{
classProgram
{
staticvoid Main(string[] args)
{
atm m = newatm();
char B=m.bal(char B);
char D=m.diposit(char D);
char W=m.withdraw(char W);
char Q=m.Exist(char Q);
}
}
classatm
{
privatedouble balance = 10000;
privateint password = 136810;
privatechar ch;
publicint menu(char ch)
{
while (true)
{
Console.WriteLine("Select B, D, W, or Q to quit");
string command = Console.ReadLine();
}
}
publicint bal(char B)
{
if (ch == 'B')
{
printBalance(balance);
}
}
publicint deposit(char D)
{
if (ch == 'D')
{
Console.WriteLine("How much do you want to deposit?");
string amount = Console.ReadLine();
double amt = Double.Parse(amount);
balance += amt;
printBalance(balance);
}
}
publicint withdraw(char W)
{
if (ch == 'W')
{
Console.WriteLine("How much do you want to withdraw?");
string amount = Console.ReadLine();
double amt = Double.Parse(amount);
if (amt > balance)
{
Console.WriteLine("Sorry but you only have $" + balance);
}
}
else
{
balance -= amt;
printBalance(balance);
}
}
publicint Exist(char Q)
{
if (ch == 'Q')
{
Console.WriteLine("exist");
}
else
{
Console.WriteLine("Sorry but that command was not understood");
}
}
publicint printBalance(double balance)
{
Console.WriteLine("Your current balance is $" + balance);
}
}