How to display full name to the console after entering first and last name in C#? [closed]












-5














I have written this code inside Student class:



public string FullName
{
get
{
return FirstName + " " + LastName;
}

}

public void PrintInformation()
{
Console.WriteLine($"Age: {Age} ");
Console.WriteLine($"ID: {StudentNumber} ");
Console.WriteLine($"Full name: {FullName}");

}


FirstName and LastName are inherited from Person class. Inside the Main method:



        Student student = new Student();

Console.Write("Please enter first name: ");
person.FirstName = Console.ReadLine();

Console.Write("Please enter last name: ");
person.LastName = Console.ReadLine();
student.PrintInformation();


I am trying to display FullName as a calculated property (firstname+lastname) to the console but I cannot find what is wrong with this code.










share|improve this question







New contributor




Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as off-topic by Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal Dec 24 at 2:37


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal

If this question can be reworded to fit the rules in the help center, please edit the question.


















    -5














    I have written this code inside Student class:



    public string FullName
    {
    get
    {
    return FirstName + " " + LastName;
    }

    }

    public void PrintInformation()
    {
    Console.WriteLine($"Age: {Age} ");
    Console.WriteLine($"ID: {StudentNumber} ");
    Console.WriteLine($"Full name: {FullName}");

    }


    FirstName and LastName are inherited from Person class. Inside the Main method:



            Student student = new Student();

    Console.Write("Please enter first name: ");
    person.FirstName = Console.ReadLine();

    Console.Write("Please enter last name: ");
    person.LastName = Console.ReadLine();
    student.PrintInformation();


    I am trying to display FullName as a calculated property (firstname+lastname) to the console but I cannot find what is wrong with this code.










    share|improve this question







    New contributor




    Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    closed as off-topic by Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal Dec 24 at 2:37


    This question appears to be off-topic. The users who voted to close gave this specific reason:


    • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal

    If this question can be reworded to fit the rules in the help center, please edit the question.
















      -5












      -5








      -5







      I have written this code inside Student class:



      public string FullName
      {
      get
      {
      return FirstName + " " + LastName;
      }

      }

      public void PrintInformation()
      {
      Console.WriteLine($"Age: {Age} ");
      Console.WriteLine($"ID: {StudentNumber} ");
      Console.WriteLine($"Full name: {FullName}");

      }


      FirstName and LastName are inherited from Person class. Inside the Main method:



              Student student = new Student();

      Console.Write("Please enter first name: ");
      person.FirstName = Console.ReadLine();

      Console.Write("Please enter last name: ");
      person.LastName = Console.ReadLine();
      student.PrintInformation();


      I am trying to display FullName as a calculated property (firstname+lastname) to the console but I cannot find what is wrong with this code.










      share|improve this question







      New contributor




      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have written this code inside Student class:



      public string FullName
      {
      get
      {
      return FirstName + " " + LastName;
      }

      }

      public void PrintInformation()
      {
      Console.WriteLine($"Age: {Age} ");
      Console.WriteLine($"ID: {StudentNumber} ");
      Console.WriteLine($"Full name: {FullName}");

      }


      FirstName and LastName are inherited from Person class. Inside the Main method:



              Student student = new Student();

      Console.Write("Please enter first name: ");
      person.FirstName = Console.ReadLine();

      Console.Write("Please enter last name: ");
      person.LastName = Console.ReadLine();
      student.PrintInformation();


      I am trying to display FullName as a calculated property (firstname+lastname) to the console but I cannot find what is wrong with this code.







      c# console properties






      share|improve this question







      New contributor




      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Dec 24 at 0:41









      Eneada Sulaj

      1




      1




      New contributor




      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Eneada Sulaj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      closed as off-topic by Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal Dec 24 at 2:37


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal

      If this question can be reworded to fit the rules in the help center, please edit the question.




      closed as off-topic by Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal Dec 24 at 2:37


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Jesse C. Slicer, 1201ProgramAlarm, Sᴀᴍ Onᴇᴌᴀ, Jamal

      If this question can be reworded to fit the rules in the help center, please edit the question.



























          active

          oldest

          votes






















          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Список кардиналов, возведённых папой римским Каликстом III

          Deduzione

          Mysql.sock missing - “Can't connect to local MySQL server through socket”