Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use Visual Studio and c# lauguage to create class and solve the question,please. You will practice working with properties and using List. 2. public void

use Visual Studio and c# lauguage to create class and solve the question,please.

image text in transcribed

You will practice working with properties and using List. 2. public void Setowner(string owner) - This method simply assigns the argument to the appropriate field. Creating a Pet class 3. public void Train()-This method sets the property Create the following class IsHouseTrained to true. Test Harness In your main method write the code to do the following: 1. Create four objects. You decide on the arguments 2. Create a List to store all the above objects. 3. Use some of the methods on some of the objects. 4. Using a suitable looping statement, display all the objects in the collection. 5. Prompt the user for an owner's name and then display only the pets belonging to a particular person. Description of members: Fields: There are no fields. Properties: 1. The properties are self-explanatory. The getter is public and the setter is mostly absent. Constructor: 1. public Pet(string name, int age, string description) - This constructor takes three arguments and assigns them to the appropriate properties. It also initializes the fields owner to "no one" and isHousedTrained to false Methods: 1. public override string ToString()-This method returns a string fully describing this object

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

What is a store brand? How do retailers use store brands?

Answered: 1 week ago