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#

what is wrong with this code also im a begginner is this good for a person doing c# for 2 days

using System;

namespace houses { class Program { static void Main() {

      string firstname = Console.ReadLine();

      string lastname = Console.ReadLine();

      string email = Console.ReadLine();

      string number = int.parse.Console.ReadLine();

      string age = int.parse.Console.Readline();

      Console.Write("what is your" + firstname + "?");

      Console.Write("what is your" + lastname + "?");


      Console.Write("what is your" + email + "?");

      Console.Write("what is your" + number + "?");

     int.parse.Console.WriteLine("what is your" + age + "?");
















    }      

    }


    }

2 Answers

Steven Parker
Steven Parker
231,110 Points

At first glance, what stands out is the lines like "string number = int.parse.Console.ReadLine();". You probably meant something like: "int number = int.Parse(Console.ReadLine());" since "int.Parse":

  • is spelled with a capital "P"
  • returns a number instead of a string
  • is a function that would take an argument in parentheses

I'd need to know what the objective of the code is to evaluate it further. When posting something related to a course, always provide a link to the course page with it, and describe what kind of problem you are having.

this is independent work not a course.

Steven Parker
Steven Parker
231,110 Points

Hopefully you found my hints helpful. Good luck with your project, and happy coding!

tanks that was helpful.