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 (2) Extend to also output in reverse.  Enter integer: 99 Enter double: 3.77 Enter character: z Enter string: Howdy 99 3.77 z Howdy Howdy z 3.77 99 (3) Extend to cast the double to an integer, and output that integer.  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 #include #include // Supports use of "string" data type using namespace std; int main() { int userInt; double userDouble; // FIXME: Define char and string variables cout << "Enter integer:" << endl; cin >> userInt; // FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by a space // FIXME (2): Output the four values in reverse // FIXME (3): Cast the double to an integer, and output that integer return 0; } Write in C++ Please. Thank You.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 29PE
icon
Related questions
Question

 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

(2) Extend to also output in reverse. 

Enter integer: 99 Enter double: 3.77 Enter character: z Enter string: Howdy 99 3.77 z Howdy Howdy z 3.77 99

(3) Extend to cast the double to an integer, and output that integer. 

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

#include <iostream>
#include <string> // Supports use of "string" data type
using namespace std;

int main() {
int userInt;
double userDouble;
// FIXME: Define char and string variables

cout << "Enter integer:" << endl;
cin >> userInt;

// FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by a space


// FIXME (2): Output the four values in reverse


// FIXME (3): Cast the double to an integer, and output that integer

return 0;
}

Write in C++ Please. Thank You.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,