Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions

Question

What is the difference between aggression and passive-aggression?

Answered: 1 week ago

Question

How flying airoplane?

Answered: 1 week ago

Question

c. What were the reasons for their move? Did they come voluntarily?

Answered: 1 week ago

Question

5. How do economic situations affect intergroup relations?

Answered: 1 week ago