Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# CODE PLEASE. C# CODE with PICTURE OF CODE, Thanks! Create a new project, called YOURNAME _Lab1BClass. You should consider developing the methods for this

C# CODE PLEASE. C# CODE with PICTURE OF CODE, Thanks!

    1. Create a new project, called YOURNAME_Lab1BClass.
      • You should consider developing the methods for this project incrementally.
    1. Now create another class inside of your project. Go to the Solution Explorer panel, right click on the project name and select Add -> Class.
      • Name the class at the bottom of the pop-up window, Person.
    1. Inside of your Person class add two class variables, one for first and one for last name.
    1. Create a default (no parameters) constructor method that sets their first name to "Bob and last name to Smith.
    1. Create an overloaded constructor method that takes in two parameters and sets their names to them. One parameter will be their first name and the second will be their last name.
    1. Create a getter/accessor method and setter/mutator method for both their first and last names.
    1. Lastly, create an overriden ToString method that will return the persons first then last name.
      • Hint: The method header would be:

public override String ToString()

    1. In your Main method, create an object/instance of your Person class using the default constructor.
    1. Create another Person using the overloaded constructor. Have the values that are passed in as arguments come from user input (ReadLine).
    1. Directly print out both peoples values using the ToString method.
      • Hint: The ToString method is automatically called when an object/instance is placed into a WriteLine method call.
    1. Now change one persons first name to Aly and the other persons last name to Sanchez.
      • Hint: Use the setters/mutators to do so. Please do not create two entirely new objects.
    1. Finally, print out both names for both people using the getters/accessors.

C# CODE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

Show Theorem 3.3. Hint: Show that x1 f (x j r ) 1 r2 f (x j r 2).

Answered: 1 week ago