Home / Expert Answers / Computer Science / 1-38-variables-input-and-casting-java-1-prompt-the-user-to-input-an-integer-a-double-a-char-pa529

(Solved): 1.38 Variables, input, and casting (Java) (1) Prompt the user to input an integer, a double, a char ...



student submitted image, transcription available belowstudent submitted image, transcription available below
1.38 Variables, input, and casting (Java) (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. (Submit for 2 points). Enter integer: 99 Enter double: 3.77 Enter character: Enter string: Howdy Howdy (2) Extend to also output in reverse. (Submit for 1 point, so 3 points total). Enter integer: 99 Enter double: 3.77 Enter character: Enter string: Howdy Howdy Howdy z (3) Extend to cast the double to an integer, and output that integer. (Submit for 2 points, so 5 points total). Enter integer: 99 Enter double: 3.77 Enter character: Enter string: Howdy Howdy Howdy z 3.77 cast to an integer is 3 jimport java.util.Scanner; public class BasicInput \{ public static void main(String[] args) \{ 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 ; // FIXME (1): Finish reading other items into variables, then output the four values on a single line separat // FIXME (2): Output the four values in reverse // FIXME (3): Cast the double to an integer, and output that integer return; \}


We have an Answer from Expert

View Expert Answer

Expert Answer



We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe