Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Problem3FormattingNumbers {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int a = console.nextInt();
- double b = console.nextDouble();
- double c = console.nextDouble();
- String hexadecimal = Integer.toHexString(a).toUpperCase();
- String binary = Integer.toBinaryString(a);
- System.out.printf("|%1$-10s|%2$010d|%3$10.2f|%4$-10.3f| ", hexadecimal, Integer.parseInt(binary), b, c);
- }
- }
Add Comment
Please, Sign In to add comment