Check out example codes for "speed limit c++". It will help you in understanding the concepts better.

Code Example 1

int main()
{

   double speed = 0;
  // double limit = 65;
   double fine = 10;

  
cout << "Input speed of vehicle: ";
cin >> speed;


//fine = ((speed - limit) * 10);
//cin >> fine >> endl;

if (speed > 65)
{cout << "You should slow down " << endl;
fine = ((speed - limit) * 10);

//cout << "Your fine is ";
//cin >> fine >> endl;
}  
else if (speed >= 40)
{cout << "You are doing a great job " << endl;
//fine = 0
}
else if (speed <= 39)
{cout << "You need to speed up " << endl;
//fine = 0


}

     
    system("pause"); //holds the command window open
    return 0; //ends the program
}

Learn ReactJs, React Native from akashmittal.com