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# C# Basics (Retired) Perfect if / else if / else

Help pls (console) Any suggestions?

Hey, before I write anything for an input it writes :7:1R. The input keeps changing everytime.

Any suggestions?

3 Answers

I dont think its about the code because sometimes it happens and sometimes does not

using System;

namespace Treehouse.FitnessFrog
{
  class Program
  {
      static void Main()
      {
        int runningTotal = 0;
        bool keepGoing =  true;
        while(keepGoing){
          Console.Write("Enter how many minutes you exercised or type q: \n");

          string entry = Console.ReadLine();

          if(entry == "q"){
            keepGoing = false;
          }
          else{
            int minutes = int.Parse(entry);
            runningTotal += minutes;
            Console.WriteLine("Youve exercised" + minutes + "minutes");
          }
        }

      }
  }
}
James Churchill
James Churchill
Treehouse Teacher

Erdem,

Just to clarify, if you compile and execute this code in Workspaces using mcs Program.cs && mono Program.exe, you'd see the output ":7:1R" written to the console before being prompted for your input?

Thanks ~James

James Churchill
STAFF
James Churchill
Treehouse Teacher

Erdem,

Are you using Workspaces or Visual Studio? Also, are you still experiencing an issue with this code?

Thanks ~James

I was using workspaces and the problem continued for a while. Then I stopped using workspaces and now using sublime/terminal. I guess there is a problem with workspaces.

Thanks for your concern,

Erdem

James Churchill
STAFF
James Churchill
Treehouse Teacher

Erdem,

Could you post your code?

Thanks ~James