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) Console I/O Formatting Output

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
217,443 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?

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