(1) Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output those four values on a single line separated by a space. Enter integer:...


(1) Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output those four values on a single line separated by a space.


Enter integer:


99


Enter double:


3.77


Enter character:


z


Enter string:


Howdy


99 3.77 z Howdy



import java.util.Scanner;


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


System.out.println("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




Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here