Program
public class Main
{
long acc_num;
float amount = 0;
void deposite(float f)
{
amount = amount + f;
}
void Withdraw(float f)
{
if (f > amount)
{
System.out.println("limited");
}
else
{
amount = amount - f;
}
}
public static void main(String args[])
{
Main b = new Main();
b.deposite(5000);
b.Withdraw(500);
System.out.println("your balance =" + b.amount);
}
}
public class Main
{
long acc_num;
float amount = 0;
void deposite(float f)
{
amount = amount + f;
}
void Withdraw(float f)
{
if (f > amount)
{
System.out.println("limited");
}
else
{
amount = amount - f;
}
}
public static void main(String args[])
{
Main b = new Main();
b.deposite(5000);
b.Withdraw(500);
System.out.println("your balance =" + b.amount);
}
}
No comments:
Post a Comment