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
JAVA QUESTION::
allochka39001 [22]

Answer:

3) 44 10 44

Explanation:

Given data

int [] val = { 3, 10, 44 };

The total number of parameters of given array are 3, so total length of array is also 3.

The indexing of array starts with '0', Therefore the <u>indexes</u> of array with length zero are: {0,1,2}

The value of array at index 0 is = 3

similarly

value at index 1 = 10

value at index 2 = 44

Any value of index 'i' of an array is selected using array[i].

Therefore,

val[0] is selecting the value of array located at index '0'.

val[0] = 3

val[2] is selecting the value of array located at index '2'.

val[2] = 44

Finally,

val[0] = val[2]; is copying the value placed at index 2 (44) to value placed at index 0 (3). Hence, the output would be { 44 10 44}. So 3rd option is correct.

 

8 0
3 years ago
Peter has recently bought a media player and a digital camera. He wants to buy a memory card for these devices. Which memory dev
Rashid [163]
Flash drive is probably the answer
8 0
3 years ago
Read 2 more answers
Need the answer ASAP!!!!!!!!!!!!! I’ll mark brainliest if correct
Dmitriy789 [7]

Answer: review; quality

Explanation:

SQA refers to the ongoing process that can be found in the Software Development Life Cycle whereby the developed software is checked in order to ensure that the desired quality measures are met. The SQA processes is vital as it checks for the quality in every development phase.

The first step of the SQA process is to (review) the software development process. The next step is to set (quality) attributes.

6 0
2 years ago
Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
Elden [556K]

Answer:

(number%100) / 10

(number%1000) / 100

Explanation:

5 0
3 years ago
Hey friends,<br><br> What is a IT form?<br><br> thanks
ziro4ka [17]

Hi buddy, an IT form is for people who are applying at a TECH college.

Love u <3

Hope this helps

8 0
3 years ago
Other questions:
  • Which of the following jobs are most likely to be in greater demand due to the increasing prevalence of mobile computing? deskto
    13·1 answer
  • What are the five resources paid for by local taxes
    15·1 answer
  • which statement draws an accurate comparison between social media marketing and conventional marketing?
    13·1 answer
  • Select the correct answer.
    15·1 answer
  • What two pieces of information would you need in order to measure the masses of stars in an eclipsing binary system?
    9·1 answer
  • A class is a _____, which encapsulates _____ and _____. (Points : 2) programming language construct; attributes; behavior
    7·1 answer
  • What is the text that is entered into a cell used to identify the purpose of the worksheet, columns, and rows? a. date and time
    14·1 answer
  • Why would a programmer use a flow chart? (Edge2020 Coding Critical Thinking Questions)
    9·1 answer
  • Which of the following is NOT a file format used for word processing documents? A. .ppt B. .rtf C. .doc D. .odt
    5·1 answer
  • Please answer me fast ​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!