jnbsjhsbcjdh28671 jnbsjhsbcjdh28671
  • 23-12-2020
  • Computers and Technology
contestada

Write a function that prompts the user to enter the speed of a vehicle. If speed is less than 20, display too slow; if speed is greater than 80, display too fast; otherwise, display just right

Respuesta :

PhantomWisdom PhantomWisdom
  • 24-12-2020

The code of the given problem is given below :

#include<iostream>

using namespace std;

void print( float speed ){

      if(speed < 20 )

      {

             cout<<"too slow\n";

      }

      else if(speed > 80 )

      {

             cout<<"too fast\n";

      }

      else{

             cout<<"right\n";

      }

}

int main()

{

      print( 18.6 );

      print( 45 );

      print( 100 );

      return 0;

}

Answer Link

Otras preguntas

i need help with #16. please show an example, i do not get this,
state a synonym for the term stealthy
Two buses leave houston at the same time and travel in opposite directions. one bus averages 55 miles per hour, and the other bus averages 45 miles per hour. wh
How did social change in europe contribute to european expansion overseas?
Can you get an mri if you have staples placed in the chest
What is the quotient of 2/3 and 2/9?
How many times can you make $0.75 with nickels,dimes, and quarters?
A 67-year-old woman, whose husband died 18 months ago, is admitted to the hospital because of severe headaches for 4 weeks. She is quiet and seems sad. She beli
How are American literature and the American identity interrelated?
How did religious leaders attempt to resolve the Iconoclast Controversy?