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# C# Basics (Retired) Console I/O Formatting Output

dsteelz
dsteelz
1,203 Points

code wont work

my code doesn't work and i don't know why. it keeps giving me the same error whenever i input something. for instance, i typed 50 as input for minutes exercised, and i said "bash: 50: command not found ". below is my code

namespace Treehouse.FitnessFrog { using System; //using directive to reduce amount of typing needed class Program { static void Main() { // prompt the user for minutes exercised Console.Write("Enter how many minutes you exercised: "); string entry = Console.Readline();

    // add minutes exercised to total
    // display total minutes exercised
    //Console.WriteLine("you excersized " +entry+ " minutes");
    // repeat until user quits 
  }

} }

i commented out the print statement to see if the error had something to do with it. even after i did, i still got the error

1 Answer

Steven Parker
Steven Parker
231,275 Points

:point_right: It looks like your program is not running..

The error message "bash: 50: command not found" is from the command shell, and indicates your program has already stopped running.

I see in your code above you have written Console.Readline with a lower-case "l" but the system function name is Console.ReadLine with a capital "L". This should have caused a compiler error, didn't you see one?

dsteelz
dsteelz
1,203 Points

thanks for the help. No, I didn't notice the compiler error. I will be more attentive to the console from now on