Question: write a program that reads in 3 double values and aligning them on three separate lines, all indented to the right side. (java) i'm having
write a program that reads in 3 double values and aligning them on three separate lines, all indented to the right side. (java)
i'm having trouble understanding how to indent to the right side of the screen.
code for ref:
import java.util.*; public class Try { public static void main(String[] args) throws Exception { Scanner scan = new Scanner(System.in); double val1, val2, val3; val1 = scan.nextDouble(); val2 = scan.nextDouble(); val3 = scan.nextDouble(); System.out.printf("%5.2f %5.2f %5.2f", val1, val2, val3); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
