Advertisement
KeeganT

Ch8Ex2 Main

Mar 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package ch8ex2;
  2. import java.util.Scanner;
  3.  
  4. public class Ch8Ex2
  5. {
  6.     public static void main(String[] args)
  7.     {
  8.         Scanner sc=new Scanner(System.in);
  9.         System.out.println("Enter an integer: ");
  10.         int number=sc.nextInt();
  11.         Num num=new Num(number);
  12.         char choice=' ';
  13.         while(choice!='q')
  14.         {
  15.             System.out.println("Show (W)hole number.");
  16.             System.out.println("Show (O)nes place number.");
  17.             System.out.println("Show (T)ens place number.");
  18.             System.out.println("Show (H)undreds place number.");
  19.             System.out.println("(Q)uit");
  20.             System.out.print("Enter your choice: ");
  21.             choice=sc.next().charAt(0);
  22.             num.extract(choice);
  23.         }
  24.     }  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement