Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

My first OOP bug ( please help)

Zorro26Zorro26 Posts: 21Member
Here is the code:

[code]
using System;

namespace ThisOldMan
{
class ThisOldMan
{
static void main(string[] args)
{
doVerse(1);
doChorus();
doVerse(2);
doChorus();
}// end main

static void doChorus()
{
string message = "";
message += "
...With a knick-knack paddy whack
";
message += "Give a dog a bone
";
message += "This old man came roling home.";
message += "

";
System.Console.WriteLine(message);
}// end doChorus()

static void doVerse(int verseNum)
{
string message = "";
message += "This old man, he played ";
message += verseNum;
message += ".
He played knick-knack ";
message += getPlace(verseNum);
Console.WriteLine(message);
}// end verse

static string getPlace(int verseNum)
{
string message = "";
switch (verseNum)
{
case 1:
message = "on my thumb ";
break;
case 2:
message = "on my shoe ";
break;
default:
message = "not yet defined";
break;
}// end switch
return message;
}//end getPlace
}// end class
}// end namespace
[/code]

Here is the error message VS2008 gives me on compilation:

Error 1 Program 'C:UsersShalomDocumentsVisual Studio 2008ProjectsC#SongSongobjDebugSong.exe' does not contain a static 'Main' method suitable for an entry point Song

Thanks in advance


Comments

Sign In or Register to comment.