• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

Does not have an entry point

I'm hitting error of "<dir exe> does not have an entry point" when build my code can anyone take a look and solve the error. I Also any suggestion to with my current code to make it more short and efficient. I'm quite new in C#.
ZodiacSign.cs.txt
0
knightofdawn
Asked:
knightofdawn
  • 3
1 Solution
 
BalkisBrCommented:
Main function should be static

replace with the following code
                public static void Main(string[] args)
		{
			//
			// TODO: Add code to start application here
			//
			//
			Console.WriteLine(("Enter your Birth Month"));
			string ZodiacMonth = Console.ReadLine();
 
			Console.WriteLine(("Enter your Birth Day"));
			string ZodiacDay = Console.ReadLine();
			int ZD = Convert.ToInt32(ZodiacDay);
		
			
			//Return Zodiac
            Zodiac objZodiac = new Zodiac();
            string sign = objZodiac.DetermineZOdiacSign(ZodiacMonth, ZD);
			Console.WriteLine("your Zodiac Sign is: ", sign);
		}

Open in new window

0
 
BalkisBrCommented:
Just to practice, You can try to use the
- switch statement (sample)  ... and
- Enumerators to Month and ZodiacSign

let me know if you need any help

            switch (MonthOfBirth)
            {
                case "Jan":
                    if (DayOfBirth < 20)
                        ZodiacSign = "CAPRICORN";
                    else ZodiacSign = "AQUARIUS";
                    break;
                case "Feb":
                    if (DayOfBirth < 20)
                        ZodiacSign = "AQUARIUS";
                    else ZodiacSign = "PISCES";
                    break;
                default:
                    ZodiacSign = "We are not able to find any match";
                    break;
            }
            return ZodiacSign;

Open in new window

0
 
knightofdawnAuthor Commented:
The codes works fine now but when the *.exe is executed after I input day the programs terminate. How could I verify the output?
0
 
BalkisBrCommented:
You can put a ReadLine, so the program will wait for you to press the "Enter" key
//place this code in the end of your main function
Console.ReadLine();

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now