Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C#

Tojo Alex
PLUS
Tojo Alex
Courses Plus Student 13,331 Points

I have several error's

These are my error's: Program.cs(40,21): warning CS0642: Possible mistaken empty statement
Program.cs(42,21): error CS1002: ; expected
Program.cs(43,20): error CS1525: Unexpected symbol else' Program.cs(44,20): error CS1525: Unexpected symbol{'
Program.cs(46,21): error CS1002: ; expected
Compilation failed: 5 error(s), 1 warnings This is my code: using System;

namespace Treehouse.FitnessFrog//namespace { class Program//class { static void Main()//method {

    int runningTotal = 0;
    bool keepGoing = true;

    while(keepGoing)
    {
      //prompt user for minutes exercisesd
      Console.Write("Enter how many minutes you exercised or type \"quit\" to exit: ");
      string entry = Console.ReadLine();

      if (entry == "quit")
      {
        keepGoing = false;
      }
      else
      {

      int minutes = int.Parse(entry);
      if(minutes <= 10)
      {
        Console.WriteLine("Better than nothing");
      }
        else if(minutes<=30)
        {
          Console.WriteLine("Way to go");
        }
        else if(minutes <=60)
        {
          Console.WriteLine("Pizza tonight!");
        }
        else
        {
          Console.WriteLine("you are just showing off!");
         }                   

      //add minutes exd to total
      runningTotal = runningTotal + minutes;

      Console.WriteLine("You entered " + runningTotal + " minutes");
      //Display total minutes exercised to the screen




      //repeat until user quits

    }
 }
}

} }

Steven Parker
Steven Parker
216,083 Points

If this is for a challenge, please provide a link to the course page. If you are following along with the videos, please make a snapshot of your workspace and post the link to it here.

Steven Parker
Steven Parker
216,083 Points

Did you want to delete the question? Click the little rectangle with 3 dots in it to reveal the option.

2 Answers

Steven Parker
Steven Parker
216,083 Points

In that case, you could make it more useful to other students if you describe what you discovered about the example shown that was incorrect.