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
ValentinkaMS [17]
3 years ago
13

Declare k, d, and s so that they can store an integer, a real number, and a small word (under 10 characters). Use these variable

s to first read in an integer, a real number, and a small word and print them out in reverse order (i.e., the word, the real, and then the integer) all on the same line, separated by EXACTLY one space from each other. Then, on a second line, print them out in the original order (the integer, the real, and the word), separated again by EXACTLY one space from each other.
Computers and Technology
1 answer:
Svetradugi [14.3K]3 years ago
5 0

Answer:

int k;

double d;

char s[10];

cin >> k >> d >> s;

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s;

Explanation

First Step (declare K, d, s) so they can store a integer

int k;

double d;

char s[10];

Second Step (read in an integer, a real number and a small word)

cin >> k >> d >> s;

Third Step ( print them out )

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s;

You might be interested in
help users calculate their car miles per gallon. write a program to allow a user to enter the number of miles driven and the num
Tpy6a [65]

Answer:

The c++ program for the scenario is given below.

#include <iostream>

using namespace std;

int main() {    

   float miles, gallon, speed;

   char reply;    

   cout<<"This program calculates speed of your car in miles per gallon." <<endl;    

   do

   {

       do

       {

           cout<<endl<<"Enter the miles driven by your car" <<endl;

           cin>>miles;

           if(miles<=0)

           {

               cout<<"Invalid input. Enter the miles driven by your car."<<endl;

               cin>>miles;

           }            

       }while(miles<=0);        

       do

       {

           cout<<"Enter the gallons of gas used by your car" <<endl;

           cin>>gallon;

           if(gallon<=0)

           {

               cout<<"Invalid input. Enter the gallons of gas used by your car."<<endl;

               cin>>gallon;

           }

       }while(gallon<=0);    

       speed = miles/gallon;

   

       cout<<"Your car drives at "<<speed<<" miles per gallon."<<endl;        

       cout<<"Do you with to continue (y/n)?"<<endl;

       cin>>reply;        

   }while(reply != 'n');    

   return 0;

}  

This program calculates speed of your car in miles per gallon.

Enter the miles driven by your car

0

Invalid input. Enter the miles driven by your car.

-9  

Enter the miles driven by your car

12.34

Enter the gallons of gas used by your car

0

Invalid input. Enter the gallons of gas used by your car.

-2

Enter the gallons of gas used by your car

3.4

Your car drives at 3.62941 miles per gallon.

Do you with to continue (y/n)?

n

Explanation:

The do while loop is also known as post-test loop. This loop executes once mandatorily. After first execution, the condition is tested and based on the condition, the loop either executes again or discontinues.

In this program, the loop continues till the user wants to try out different sets of data for calculation. Once the user enters input to quit, the loop discontinues.

Do

{  

cout<<"Do you with to continue (y/n)?"<<endl;

        cin>>reply;

}while(reply != 'n');

Moreover, the input by the user is tested for validity. The input cannot be negative or zero. This is implemented by if statement.

if(miles<0)

       {

           cout<<"Invalid input. Miles cannot be negative."<<endl;

           cin>>miles;

       }

The same validity is implemented for gallons of gas also.

8 0
3 years ago
Can someone take away your points
Julli [10]

Answer:

no why do you ask.. . ...........

7 0
3 years ago
In microsoft word, pressing the ____ key(s) will move the insertion point to the end of the document.
Shalnov [3]
Hey there!

In Microsoft Word, you can combine the keys Ctrl + End to jump to the very end of the document's text body. You can also use a variety of other keyboard shortcuts similar this one to move your cursor around your document. 

Hope this helped you out! :-)
8 0
3 years ago
If you are to recommend type of cloud for a education institutions (e.g universities), which one would you choose? (private or p
Bas_tet [7]

Answer:Private cloud

Explanation: Education institute require some kind of security and reliability for their data so that it can remain secure between the students and the staff only and no unauthorized access can be done.

The setting up of the private cloud is a better method for sharing of the information among the institute because it is controlled by the internal sources only ,unlike the public cloud.This service enhances the security and is accessible by the organization members only with the on-request service feature.

3 0
4 years ago
Please help me on this it’s due now
ivanzaharov [21]
Bottom right goes first then top right for the second part!
7 0
3 years ago
Other questions:
  • "How has graphic design changed through time?"
    10·1 answer
  • Digital cameras are less susceptible to UV light true or false
    13·2 answers
  • The piece of hardware that contains the circuitry that processes the information coming in to the computer and tells the other h
    8·1 answer
  • Exit windows entirely and turns off the computers power
    8·1 answer
  • What is the value of the variable named result after the following code executes? var X = 5; var Y = 3; var Z = 2; var result =
    14·1 answer
  • The advantage of returning a structure type from a function when compared to returning a fundamental type is that
    5·1 answer
  • All the following are the basis of the World Wide Web except:
    14·2 answers
  • Why is making a model, or prototype, important in the design process?
    6·1 answer
  • You are designing software for elderly people. Which two features can you
    6·1 answer
  • True or Fale A criminal defense attorney's main focus is to convict the accused of a crime, and a state prosecutor is to defend
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!