
Chukwunonso Emmanuel
Pro Student 3,046 Pointsif the speed is over 55
using System;
class Program
{
static void CheckSpeed(double speed)
{
// YOUR CODE HERE
}
static void Main(string[] args)
{
// This won't print anything.
CheckSpeed(53);
// This should print "too fast".
CheckSpeed(88);
}
}
1 Answer

Martin Murphy
19,318 PointsA simple if statement in CheckSpeed should do this:
using System;
class Program
{
static void CheckSpeed(double speed)
{
// YOUR CODE HERE
if (speed > 55)
{
Console.WriteLine("too fast");
}
}
static void Main(string[] args)
{
// This won't print anything.
CheckSpeed(53);
// This should print "too fast".
CheckSpeed(88);
}
}