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 trialgregowens
3,757 PointsFinal Challenge Task 3
I keep getting: Bummer! I entered -1. I expected "You must enter a positive number.", but got "You must enter a postive number." instead.
Any tips to point me in the right direction?
using System;
namespace Treehouse.CodeChallenges { class Program { static void Main() {
Console.Write("Enter the number of times to print \"Yay!\": ");
var input = Console.ReadLine();
try{
var EnterNumber = int.Parse(input);
if(EnterNumber <=0){
Console.Write("You must enter a postive number.");
} else {
for(var i=1; i<=EnterNumber; i++){
Console.WriteLine("Yay!");
}
}
}
catch(FormatException){
Console.WriteLine("You must enter a whole number.");
}
}
}
}
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! You simply have a spelling error. Double-check your spelling of "positive". You've accidentally written "postive". Note that your spelling is missing an "i".
Good luck and you're doing very well!
gregowens
3,757 PointsWow, sorry for bugging you with that :) Thank you very much!