Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Any help would be great thanks. I need to write a program simulating a state pol

ID: 3629181 • Letter: A

Question

Any help would be great thanks.

I need to write a program simulating a state police radar detector speed. The program should read an automobile speed and print the message "speeding" if the speed exceeds 55 mph.

In this program the if else statement are used. This is what I have so far. I dont know if its correct.

#include <iostream>
using namespace std;

int main()
{

int speed;


if (speed > 55)
radar = speeding;
else if (speed < 55)
radar = not speeding;



cout << "The car is speeding when the speed is > 55" It is not speeding when the speed is speed < 55

return 0;
}

Explanation / Answer

please rate - thanks

#include <iostream>
using namespace std;

int main()
{
int speed;
cout<<"Enter car speed: ";
cin>>speed;
if (speed > 55)
     cout<<"Speeding ";
else
     cout<<"Not speeding ";
system("pause");
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote