Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

TwoFer program Bug

I ran into a problem while writing the TwoFer program
enter image description here

This is the program’s code

public static class TwoFer
{
    public static string Speak()
    {
        return "One for you, one for me.";
    }
    public static  Speak(string h)
    {

        if (h == "Bob")
        {
            return "One for Bob, one for me.";
        }
        else
        {
            return "One for Alice, one for me.";
        }
    }
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Your Speak(string) method is missing a return type:

public static String Speak(string h)
// Here ------^
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading