Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

// 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 name

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

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions