4.7 Lab Warmup: Numeric Output Formatting
The template code reads in two numbers from the user.
Modify the code to:
(1) Use printf to output the numbers rounded to 1 decimal place,so that their decimals line up.
Display leading zeros, with a total of 6 digits displayed beforethe decimal.
(2) After a blank line, use printf to output the numbers a secondtime, rounded to 2 decimal places, so that their decimals lineup.
Display blanks before the actual digits, with a total of 6characters appearing before the decimal.
Enter two double numbers:4.567876.5432000004.6000876.5 4.57 876.54
import java.util.Scanner;
public class NumberFormatting {
public static void main(String[] args)
PayPal Gateway not configured
PayPal Gateway not configured