Java projects | ATM Machine projects in java | ATM projects | Java practices | learn Java | Java Miniprojects
Java Mini projects
Project Defintion:
This projects like a commend like project . it is more use for many beginners to practice in our programming skills .this project name is ATM machine project.because, this projects should perform like a ATM machine . i would use the fnction are Deposite,withdrawel,balance and acconut creation .And i should tell one thing of this projects because that projects is more sequrly to create for the client . please use that . i hope you will definly like that project.
Functions :
- Deposite
- Balance
- Account creation
- withdrawel
Code :
import java.util.*;
class demo
{
int count = 0;
String client ;
int Total = 0;
Scanner sc = new Scanner(System.in);
public void Account()
{
System.out.println("Enter the No : ");
client = sc.next();
System.out.println("Account created SuccessFully....");
System.out.println("And Deposited Initial amount is 1000");
Total = 1000;
}
public void Balance()
{
System.out.println("Please Enter For in Your No for Verification : ");
String No = sc.next();
if(No.compareTo(client) == 0)
{
System.out.println("Your Account Verified....");
System.out.println("And Your Balance is : "+Total);
}
else
{
System.out.println("Enter a Correct No..xxxxx");
}
}
public void deposite()
{
System.out.println("Please Enter For in Your No for Verification : ");
String No = sc.next();
if(No.compareTo(client) == 0)
{
System.out.println("Your Account Verified....");
System.out.println("Enter How Much would You Like to deposite : ");
int Amount = sc.nextInt();
Total = Total + Amount;
System.out.println("Deposited Successfully....");
}
else
{
System.out.println("Wrong Account Number.....");
}
}
public void withdrawal()
{
System.out.println("Please Enter For in Your No for Verification : ");
String No = sc.next();
if(No.compareTo(client) == 0)
{
System.out.println("Your Account Verified....");
System.out.println("How Much Would Like get : ");
int withdraw = sc.nextInt();
if(withdraw < Total)
{
Total = Total - withdraw;
}
else
{
System.out.println("Your Have a exactly "+withdraw+" amount (or) Less Value of Amount");
System.out.println("Sorry.....");
}
}
else
{
System.out.println("Please Correct Your Account Number.... Sorry");
}
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
demo d = new demo();
int rec = 0;
do
{
System.out.println("What Process You Do Now : ");
System.out.println("1.createAccount");
System.out.println("2.Deposite");
System.out.println("3.Withdrwal");
System.out.println("4.Balance");
System.out.println("5.Exit");
int choose = sc.nextInt();
switch(choose)
{
case 1 :
d.Account();
break;
case 2 :
d.deposite();
break;
case 3 :
d.withdrawal();
break;
case 4 :
d.Balance();
break;
case 5:
System.out.println("GoodBye");
System.exit(0);
}
System.out.println("1.Continue");
System.out.println("2.Exit");
rec = sc.nextInt();
}
while(rec < 2);
}
}
Thank for visiting........
if you want any doubt ask on comment
ReplyDelete