C# C# Basics If Statements "if" Statements

Ilya Sikharulidze
PRO
Ilya Sikharulidze
Pro Student 1,071 Points

I can't seem to figure out this problem, can someone help me please

Program.cs
using System;

class Program
{

    static void CheckSpeed(double speed)
    {
        if(speed > 50.0)
        {
            Console.WriteLine("Too fast");
        }

        // YOUR CODE HERE
    }

    static void Main(string[] args)
    {
        // This won't print anything.
        CheckSpeed(53);
        // This should print "too fast".
        CheckSpeed(88);
    }

}

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 51,823 Points

From the instructions verify

1) You are checking if speed is over 55

2) You are printing the message "too fast" (this exact message)

Ilya Sikharulidze
Ilya Sikharulidze
Pro Student 1,071 Points

This doesn't seem to work as well

static void CheckSpeed(double speed) { // YOUR CODE HERE if(speed > 55.0) { Console.WriteLine("Too fast"); } }

static void Main(string[] args)
{
    // This won't print anything.
    CheckSpeed(53);
    // This should print "too fast".
    CheckSpeed(88);
}