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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!