This is practice work for a coding contest at the school, the code is pretty bad; I'm sure there are better methods to approaching the problem, and I'm sure I mucked something (or a lot of things) up along the way. I don't think I could explain it too well, but I have provided the question booklet.
And this is the output I get based on the code I provided (which I wrote):
![Posted Image]()
The images don't appear to work on the original thread post, hopefully this does.
![Posted Image]()
And this is the output I get based on the code I provided (which I wrote):

#include <iostream>
int speedCalc( int, int );
// a mess, the purpose of the table was to hold the threshhold information for determing fines
int fineTable[3][3]={1,20,100,21,30,270,31,31,500};
int main()
{
int inputLimit, inputPlaneSpeed;
std::cout <<"Enter the limit: ";
std::cin >> inputLimit;
std::cout <<"Enter the recorded speed of the car: ";
std::cin >> inputPlaneSpeed;
// Might have to clear input stream? idk
speedCalc( inputLimit, inputPlaneSpeed );
return 0;
}
int speedCalc( int speedLimit, int planeSpeed )
{
if ( planeSpeed < speedLimit )
{
std::cout <<"Congratulations, you are within the speed limit!";
std::cin.get();
}
else if ( planeSpeed > speedLimit )
{
if ((planeSpeed >= speedLimit+fineTable[1][1]) and (planeSpeed<= speedLimit+fineTable[1][2]))
{
std::cout <<"You are speeding and your fine is " <<fineTable[1][3];
}
}
}
The images don't appear to work on the original thread post, hopefully this does.
