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 var

When asked to change the variable types to "var", It continuously asks if I have changed the 'String' variable to "Var".

Is there something that needs to be done to a string variable in order to make this go through? or am I missing something on another variable that is causing this error?

CodeChallenge.cs
string input = "22";

var converted = int.Parse(input);

var wheelsAreRound = true;

var downcased = "DoNuTs".ToLower();

var success = (downcased == "donuts");

vaar total = 0.0;

3 Answers

Hey Cody,

For this challenge, your prompt is to change all variable types to 'var'. Currently, you still have input as type string. You also have spelt var incorrectly on the total variable.

var input = "22"; // Change string to var

var converted = int.Parse(input);

var wheelsAreRound = true;

var downcased = "DoNuTs".ToLower();

var success = (downcased == "donuts");

var total = 0.0; // Here

Misspelling var can hurt.

I completely missed the entire first line. This is why you don't drink and write. Thank you very much.