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 12:30
Which of the choices sean are not true when considering virus behavior
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Petrică, tânăr licean în clasa a ix-a, a primit în dar de la părinţii săi un cont bancar pentru micile sale cheltuieli curente. el este pasionat de internet banking şi îşi verifică cu grijă toate tranzacţiile efectuate. pentru creşterea securităţii tranzacţiilor online, banca îi furnizează lui petrică un număr pe care el va trebui să îl modifice, obţinând un număr tan – număr de autentificare a tranzacţiei (transaction authentication number). regula de obţinere a numărului tan este următoarea: se formează cel mai mic număr par din toate cifrele numărului furnizat de bancă. cerinţă cunoscând numărul n furnizat de bancă, să se determine numărul tan obţinut de petrică. date de intrare fişierul tan.in conţine pe prima linie numărul natural n cu semnificaţia din enunţ. date de ieşire fişierul de ieşire tan.out va conţine o singură linie pe care va fi scris numărul tan cerut. restricţii • 0 < n < 18*1018 • n are cel puţin o cifră pară • numărul tan obţinut nu poate conţine zerouri nesemnificative
Answers: 2
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
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
Mathematics, 04.08.2019 21:30