Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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
229,783 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
229,783 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
229,783 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.