subject

(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. (2 pts) Note: This zyLab outputs a newline after each user-input prompt. For convenience in the examples below, the user's input value is shown on the next line, but such values don't actually appear as output when the program runs. Enter integer: 99 Enter double: 3.77 Enter character: 2 Enter string: Howdy 99 3.77 z Howdy (2) Extend to also output in reverse (1 pt) Enter integer: 99 Enter double 3.77 Enter characteri Enter string: Howdy 99 3.772 Howdy Howdy z 3.77 99 (3) Extend to cast the double to an integer, and output that integer (2 pts) 0 en soa Enter integer: 99 Enter double: 3.77 Enter character: 2 Enter string: Howdy 99 3.77 z Howdy Howdy z 3.77 99 3.77 cast to an integer is 3 LAB ACTIVITY 14.1.1: Prog 1: Variables, input, and casting 0/5 BasicInput. java Load default template. 1 ort java. util. Scanner: 2 3 lic class Basic Input I 4 public static void main(String args) { 5 Scanner ser-new Scanner(System. in); 6 int userint; 7 double userDouble; B // FTOME Define chor and string variables similarly 9 char UserChar: 10 String userString: 11 12 System. out. println("Enter integer"): 13 user Int - ser. nextInto: 14 15 // FTXMC (1): Finish reading other items inte variables, then output the four values on a single line separated by a space

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 23:00
The animal classthis class represents a an animal residing at a zoo. it has a weight (in pounds),height (in inches), a name, and a color. the methods in the class include constructors,getters, and a tostring. you will finish the implementation of these methods. referto the code documentation.1.getters: you will need to implement getter methods. these get a value (froma member variable) in the animal class. you will make a getter method toreturn each variable (weight, height, name, color). reference getname if youare having issues.2.tostring: you will need to finish the tostring method. this returns a stringcontaining information about an animal. the output string should be of theformat: ” (name) , a ( color )â’colored animal . ( weight ) pounds , ( height ) inches .\n”the height and weight are formatted to 1 decimal place. recall from lab 1how to format strings neatly using string. see the reference sectionfor more about string.format.
Answers: 2
question
Computers and Technology, 22.06.2019 02:10
3. (5 points) describe what would be printed by the code below or what error would occur. const char* cstr = "0123456"; const char* ptr = & cstr[4]; cout < < ptr[-1] < < ptr < < endl; 1 4. (5 points) theseus has been trapped in a maze with a minotaur, which is trying to capture him. each round, theseus and the minotaur move through the maze; theseus towards the exit, and the minotaur towards theseus. theseus can move in any of the four cardinal directions, or he can wait for a round to see how the minotaur moves. write code that creates a data type to represent the possible moves that theseus could make.
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
How are roger williams, james oglethorpe, and william penn similar?
Answers: 3
You know the right answer?
(1) Prompt the user to input an integer, a double, a character, and a string, storing each into sepa...
Questions
question
Mathematics, 04.07.2020 16:01
question
Computers and Technology, 04.07.2020 16:01
question
Social Studies, 04.07.2020 16:01
question
Mathematics, 04.07.2020 16:01
question
Physics, 04.07.2020 16:01
question
Chemistry, 04.07.2020 16:01
question
Chemistry, 04.07.2020 16:01
Questions on the website: 13722367