# ATM Logic

Ashish Chaudhary
ATM Logic
Posted in : Java Beginners
Q-In an ATM program i want to print the receipt in which there is information of rupees note that come out from an ATM machine when user enters the particular amount.
For e.g. if user enters 2250 then he should get receipt in this format
1000*1=1000
500*2=1000
100*2=200
50*1=50
Total=2250
Note: The ATM should check for particular rupee note whether it is available or not
if in above example 100 rupee note is not found then the program takes 50 rupee note and so on.

PLEASE GIVE ME THE CODE FOR THIS.
AshishChaudhary
[email protected]

June 19, 2010 at 1:03 PM

Hi Friend,

import java.util.*;

class CashDispenser {
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("Enter Amount: ");
int amount=input.nextInt();
int[] rupees = {1000,500,100,50};
int[] count = {0,0,0,0};

for(int i=0;i<rupees.length;i++){
if(rupees[i]<amount || rupees[i]==amount){
count[i]=amount/rupees[i];
amount=amount%rupees[i];
}
}
for(int i=0;i<count.length;i++){
if(count[i]!=0){
System.out.println(rupees[i]+" * "+count[i]+" = "+(rupees[i]*count[i]));
}
}
}
}

Hope that it will be helpful for you.
Thanks

ATM Logic - Java Beginners
ATM Logic   Q-In an ATM program i want to print the receipt in which there is information of rupees note that come out from an ATM machine when user... Note: The ATM should check for particular rupee note whether it is available
LOGIC
LOGIC  hey guys..i have my exams coming in somedays and it would be really helpful if someone explained how to develop the logic of any program
LOGIC
LOGIC  hey guys..i have my exams coming in somedays and it would be really helpful if someone explained how to develop the logic of any program
atm machine code - Framework
atm machine code  plz send me the code of atm machine in c#.reply
ATM IN JAVA RMI - RMI
ATM IN JAVA RMI  How to write code for ATM using Java RMI
ATM machine in c#
ATM machine in c#  i am looking for a code that will be able to create an account and be able to log-in to the atm machine
atm code in servlet& jsp
atm code in servlet& jsp  pls send me the code of ATM project in servlet jsp . my requirements are first of all an user login window open then balance enquiry, withdraw of money, money transfer, then log out. pls send as early
Simple ATM Java Code...
Simple ATM Java Code...  You are required to write a Graphical User Interface that simulates an ATM by building on the program you wrote... list, following which your ATM becomes operational for use by your customers
code for ATM - Java Beginners
code for ATM  How to write code for ATM?  can you plz... javax.swing.event.*; public class ATM extends Applet { public void init... { // setting up a pin that is needed for the atm private
ATM Java Code - Java Beginners
ATM Java Code  how to write ATM code that requirement is 1)user can insert name, account number, current balance,transaction type, 2)if select transaction is money deposit, the value will be input and current balance
Logic and desgin
Logic and desgin  How would this be put in visual logic symbol
Auto Teller Machine Emulator : (ATM Emulator)
Auto Teller Machine Emulator : (ATM Emulator)  following functionalities : a) Create an ATM cash deliver emulator application that will have... as input through ATM machine and give the cash amount. ATM machine has
Logic Building
Logic Building  I wanted to devlop my logic ? How can i do so ? Can i start with java or i need to do c++ before
atm java program - Java Interview Questions
atm java program  i need an atm system program java code that requires a user to enter his pin.then after entering the pin,it will ask again the user to select from 3 choices such as [1]Inquiry [2]Withdraw [3]Deposit.then if he
Logic Iterate.
Logic Iterate.  I have one doubt about logic:iterate. I use text feild inside of logic:iterate , there is possible will generate N no of rows (text feild) inside of iterate. my doubt is how to get the Paritcular rows text
Logic Iterate.
Logic Iterate.  logic iterate Struts I have one doubt about logic:iterate. I use text field inside of logic:iterate , there is possible... the Particular rows text value. for example: print("<logic:iterate id="xid
Business logic vs Presentation logic - JSP-Servlet
Business logic vs Presentation logic  what is the difference between Business logic and Presentation logic
Logic and Degin
Logic and Degin  Need help in writing a pseudocode for this can so please help me with this just need to get started. In this lab, you are going to extend the Fireworks Checkout Stand application in Week 6. This week, we
Logic and Design
Logic and Design  Please help me with this Write a program that prompts and accepts a number between 1 and 12. After getting the input, display the number with the appropriate month. (example: This is the 1st monthÂ¦January
logic-iterate
logic-iterate  in my code i am using for-each loop for displaying data i want use tag to display data how to use plase help me <%@ page import="java.sql.*" %> <%String[] id = (String[])session.getAttribute("ids
What is programming logic ?
What is programming logic ?  What is programming logic
WEB LOGIC - JSP-Servlet
WEB LOGIC project  I want the procedure to run a project in we logic server
the business logic is executed.  In which method of Action class the business logic is executed
what is the logic of this pattern?
what is the logic of this pattern?   1 121 12321 1234321
struts logic tags
struts logic tags  what is the use of struts logic tag   The purpose of Struts logic tags is to alter output depending on the given...://www.roseindia.net/struts/struts-logictags/logic-tags-introduction.shtml http
Version of com.thesett>logic dependency
List of Version of com.thesett>logic dependency