Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started