GSculerlor

Keypad.java

Oct 26th, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. /**
  2.  * Represents the keypad of the ATM
  3.  */
  4.  
  5. // Keypad.java
  6. // Represents the keypad of the ATM
  7. import java.util.Scanner; // program uses Scanner to obtain user input
  8.  
  9. public class Keypad {
  10.     private Scanner input; // reads data from the command line
  11.  
  12.     // no-argument constructor initializes the Scanner
  13.     public Keypad() {
  14.         input = new Scanner(System.in);
  15.     } // end no-argument Keypad constructor
  16.  
  17.     // return an integer value entered by user
  18.     public int getInput() {
  19.         return input.nextInt(); // we assume that user enters an integer
  20.     } // end method getInput
  21. } // end class Keypada
Advertisement
Add Comment
Please, Sign In to add comment