Question: CHALLENGE ACTIVITY 3 . 2 . 2 : Output formatting. 5 2 2 5 6 2 3 5 7 8 1 9 4 q 3

CHALLENGE
ACTIVITY
3.2.2: Output formatting.
5225623578194 q329y7
Jump to level 1
Integer distanceRan and double distanceTraveled are read from input. Output the following:
distanceRan with a +/- sign and a minimum of 6 characters.
distanceTraveled left-aligned, a minimum of 6 characters, and 2 digits following the decimal point.
End each output with a newline.
Ex. If the input is 33,3.25, then the output is:
?3.25+33
import java.util.Scanner;
public class OutputFormatter {
public static void main(String [] args){
Scanner scnr = new Scanner(
System.in);
int distanceRan;
double distanceTraveled;
distanceRan = scnr. nextInt () ;
distanceTraveled = scnr. nextDouble();
Y** Your code goes here */
}
}
1
2
3
 CHALLENGE ACTIVITY 3.2.2: Output formatting. 5225623578194 q329y7 Jump to level 1

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!