Java Program For ATM TransAction Using Functions And Call By Value
Code:
Code:
/*
*Java Program For ATM TransAction Using Functions And Call By Value
*/
public class ATM
{
public static void Welcome()
{
System.out.println("**********GREETINGS**********");
System.out.println("WELCOME TO THE ROCKTHEIT BANK");
}
public static void TransAction(int age,double dep,double wit)
{
if (age > 18)
{
double bal=10000;//Calculate
double amt=(bal+dep);
double rembal=(amt-wit);
if(dep>0)
System.out.println("You Have Deposited An Amount of Rs."+dep+" In Your ROCKTHEIT Bank Account");
else
System.out.println("You Have Not Deposited Any Amount In Your ROCKTHEIT Bank Account");
System.out.println("Your Balance After Deposition Is Rs."+amt);
if(wit>0)
System.out.println("You Have Withdrawn An Amount Of Rs."+wit+" From Your ROCKTHEIT Bank Account");
else
System.out.println("You Have Not Withdrawn Any Amount From Your ROCKTHEIT Bank Account");
System.out.println("Your Remaining Balance Is Rs."+rembal);
System.out.println("Thank You For Using The ROCKTHEIT Bank ATM");
System.out.println("**********HAVE A GOOD DAY**********");
}
else
{
System.out.println("You Arue Underaged");
}
}
public static void main(int age,double deposit,double withdrawn)//input from BlueJ interface
{
Welcome();
TransAction(age,deposit,withdrawn);//Call By Value
}
}//End of Class
Comment bellow for your query and feedback... :)*Java Program For ATM TransAction Using Functions And Call By Value
*/
public class ATM
{
public static void Welcome()
{
System.out.println("**********GREETINGS**********");
System.out.println("WELCOME TO THE ROCKTHEIT BANK");
}
public static void TransAction(int age,double dep,double wit)
{
if (age > 18)
{
double bal=10000;//Calculate
double amt=(bal+dep);
double rembal=(amt-wit);
if(dep>0)
System.out.println("You Have Deposited An Amount of Rs."+dep+" In Your ROCKTHEIT Bank Account");
else
System.out.println("You Have Not Deposited Any Amount In Your ROCKTHEIT Bank Account");
System.out.println("Your Balance After Deposition Is Rs."+amt);
if(wit>0)
System.out.println("You Have Withdrawn An Amount Of Rs."+wit+" From Your ROCKTHEIT Bank Account");
else
System.out.println("You Have Not Withdrawn Any Amount From Your ROCKTHEIT Bank Account");
System.out.println("Your Remaining Balance Is Rs."+rembal);
System.out.println("Thank You For Using The ROCKTHEIT Bank ATM");
System.out.println("**********HAVE A GOOD DAY**********");
}
else
{
System.out.println("You Arue Underaged");
}
}
public static void main(int age,double deposit,double withdrawn)//input from BlueJ interface
{
Welcome();
TransAction(age,deposit,withdrawn);//Call By Value
}
}//End of Class
0 comments:
Confused? Feel free to ask
Post a Comment