1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
elena-s [515]
2 years ago
15

Use the variables k, d, and s so that they can read three different values from standard input--an integer, a double, and a stri

ng respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.
Computers and Technology
1 answer:
Nat2105 [25]2 years ago
7 0

Answer:

The c++ program to implement the given scenario is shown below.

#include <iostream>

using namespace std;

int main() {

   // variables declared as mentioned

   int k;

   double d;

   string s;

   cout << " Enter an integer value, a double value, a string value in the mentioned order " << endl;

   cin >> k >> d >> s;

   // variables printed in reverse order

   cout << " Reverse order " << endl;

   cout << s << " " << d << " " << k << endl;

   // variables printed in original order

   cout << " Original order " << endl;

   cout << k << " " << d << " " << s << endl;

   return 0;

}

OUTPUT

Enter an integer value, a double value, a string value in the mentioned order  

12 45.67 brainly

Reverse order  

brainly 45.67 12

Original order  

12 45.67 brainly

Explanation:

1. All the variables are declared as mentioned in the question.

int k;

   double d;

   string s;

2. The user is prompted to enter values for integer, double and string variables respectively. The input is accepted in the order mentioned above.

cin >> k >> d >> s;

3. The input is accepted in a single line since this is mentioned in the scenario that variables should be printed in the order in which they are read.

4. These variables are displayed to the standard output in reverse order – string, double, integer. The variables are displayed with exactly one space in between them.

cout << s << " " << d << " " << k << endl;

5. Then, variables are displayed in the original order – integer, double, string. The variables are displayed with exactly one space in between them.

cout << k << " " << d << " " << s << endl;

You might be interested in
Where can the Ease of Access and Speech Recognition centers be found?
Bess [88]

Answer:

bottom right

Explanation:

at least on windows it's bottom right

3 0
3 years ago
Read 2 more answers
You want to substitute one word with another throughout your
Hitman42 [59]
I’m pretty sure it’s “Find and paste”
8 0
3 years ago
I do not understand what the are asking in csys 1.3.6
Amiraneli [1.4K]

Can i see the note????

6 0
2 years ago
Match the tool to its description.
topjm [15]

Answer:

Reveal formating- A

Clear formatting-B

Apply formatting of the surrounding text-D

Format painter-C

Explanation:

7 0
2 years ago
Read 2 more answers
. The BEST description of a proprietary database is one that
AVprozaik [17]
Is free to the public
8 0
3 years ago
Other questions:
  • Write Python algebraic expressions corresponding to the following statements: (a) The sum of the first five positive integers (b
    14·1 answer
  • What is an example of constructive criticism for an employee who is shy during meetings?
    15·2 answers
  • An information system is the entire set of __________, people, procedures, and networks that enable the use of information resou
    8·1 answer
  • Which of the following statements invokes the GetDiscount function, passing it the contents of two Decimal variables named decSa
    8·1 answer
  • Which of the following methods is the easiest way to set up a VPN client on a computer for a user who is not technical?
    12·1 answer
  • With which type of social engineering attack are users asked to respond to an email or are directed to a website where they are
    9·1 answer
  • The method needed to arrange for an object to be notified when a window's close-window button has been clicked is
    6·1 answer
  • How are keyboards applied in the real world
    13·1 answer
  • Which of the following is not a benefit of introducing an e-commerce solution to an organisation?
    14·1 answer
  • Under what scenarios can we clear the NVRAM by moving the PSWD jumper to the RTCRST<br> pins?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!