Print Values of Different Types
Easyjava
Read one value of each of four types and print them on a single line separated by single spaces.
Input: four lines — an integer, a decimal number, a single character, and the word true or false.
Output: one line: <int> <double> <char> <boolean>
Example 1
Input
90 90.5 A true
Output
90 90.5 A true
- The decimal number uses a dot, e.g. 90.5
- The character is a single visible character
Hint 1
Read each token with sc.next() and convert it to the right type.
Hint 2
Concatenate with spaces: i + " " + d + " " + c + " " + b.
Convert each input token to its type (int, double, char, boolean) and print them joined by spaces. Notice that printing the double 7.0 keeps the .0, and the boolean prints as true / false.