Recap challenge #2
Lesson 7 of 12 in Coddy's Basics of Classes and Objects in C# course.
Challenge
EasyWrite a class Person with,
Attributes (must be public) -
name(string)age(integer)
Constructor that gets as input two arguments and sets them accordingly to name and age attributes.
Methods -
celebrateBirthdaythat gets no input and increases the age by one.changeNamethat gets as input a string and changes the current name with the given input.
Try it yourself
// Write code hereAll lessons in Basics of Classes and Objects in C#
1Introduction
Introduction