subject

I am trying how to give this code the correct spacing. It needs to be equally spaced.

Like this below. Please give any advice, thank you
Enter integer: 99
Enter double: 3.77
Enter character: z
Enter string: Howdy
99 3.77 z Howdy
Howdy z 3.77 99
3.77 cast to an integer is 3
import java. util. Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System. in);
int userInt = 0;
double userDouble = 0.0;
// FIXME Define char and string variables similarly
char userChar;
String userString;

System. out. println("\n Enter integer: ");
userInt = scnr. nextInt();

// FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by a space
System. out. println("\n Enter double: ");
userDouble = scnr. nextDouble();
System. out. println("\n Enter character: ");
userChar = scnr. next().charAt(0);
System. out. println("\n Enter string: ");
userString = scnr. next();
System. out. print("" + userInt + " " + userDouble + " " + userChar + " " + userString);
// FIXME (2): Output the four values in reverse
System. out. println(userString + " " + userChar + " " + userDouble + " " + userInt);
// FIXME (3): Cast the double to an integer, and output that integer
int castInt = (int)userDouble;
System. out. println("" + userDouble + " cast to an integer is " + castInt);
return;
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
The β€œrule of 72” is used to approximate the time required for prices to double due to inflation. if the inflation rate is r%, then the rule of 72 estimates that prices will double in 72/r years. for instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years. write a program to test the accuracy of this rule. for each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate. (assume prices increase at the end of each year.)
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Awide variety of β€œ apps β€œ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Asecurity policy is a a. set of guidlines b. set of transmission protocols c. written document d. set of rules based on standards and guidelines
Answers: 2
You know the right answer?
I am trying how to give this code the correct spacing. It needs to be equally spaced.

L...
Questions
question
English, 27.05.2021 22:10
question
Biology, 27.05.2021 22:10
question
Mathematics, 27.05.2021 22:10
question
Spanish, 27.05.2021 22:10
question
Mathematics, 27.05.2021 22:10
question
Mathematics, 27.05.2021 22:10
Questions on the website: 13722367