Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help, mostly confused about the c# property section // TODO: Define three member fields // An int called mMaxSize // An array of Items
Please help, mostly confused about the c# property section
// TODO: Define three member fields // An int called mMaxSize // An array of Items called mItems An int called mGold // TODO: Write a default constructor that assigns the mMaxSize to 10, mItems to a new array of Items with mMaxSize as the size, and mGold to 50. // TODO: Write a C# property for mGold called Gold (it has to access/update the mold member field). // TODO: Write a method called AddItem that returns a bool and takes an Item parameter. This method should iterate through the mItems array, looking for any array element that is null. If a null Item is found, it should assign that array element to the Item passed in and return true. Otherwise it should return false. // TODO: Write a method called GetItem that returns an Item and takes a string parameter. 1 This method should iterate through the mItems array, looking for an Item that has the same name as the parameter. If it finds a match it should return that element of the mItems array. Otherwise return null. Do not forget to make sure the element is not null before checking its name. // TODO: Write a method called RemoveItem that returns a bool and takes a string parameter. This method should iterate through the mItems array, looking for an Item that has the same name as the parameter. If it finds a match it should set that // element of the mItems array to null and return true. Otherwise return false. Do not forget to make sure the element is not null before checking its nameStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started