Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch8ex2;
- import java.util.Scanner;
- public class Ch8Ex2
- {
- public static void main(String[] args)
- {
- Scanner sc=new Scanner(System.in);
- System.out.println("Enter an integer: ");
- int number=sc.nextInt();
- Num num=new Num(number);
- char choice=' ';
- while(choice!='q')
- {
- System.out.println("Show (W)hole number.");
- System.out.println("Show (O)nes place number.");
- System.out.println("Show (T)ens place number.");
- System.out.println("Show (H)undreds place number.");
- System.out.println("(Q)uit");
- System.out.print("Enter your choice: ");
- choice=sc.next().charAt(0);
- num.extract(choice);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement