Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

class. 3. As you progress with the implementation of the methods listed above, you need to test each of them. For this purpose, use

class. 3. As you progress with the implementation of the methods listed above, you need to test each of them.

class. 3. As you progress with the implementation of the methods listed above, you need to test each of them. For this purpose, use the Account class that you have completed in Task 3.2. Import the class to your current project. You need to slightly extend it by adding one more property required to get the current account balance; that is, add the following: decimal Balance Property. Gets the balance of its account. 4. Test the Mystack class and ensure that you cover all potential logical issues and runtime errors. This (testing) part of the task is as important as writing code for this data structure. Specifically, use your Tester class to create and populate a stack of accounts (no input from the user is required; make your example hard coded). Then, you may check against multiple test cases, for example: Check whether you can find an account with a specific balance. Test the Find method for both variants: one where such account does exist in the stack, and the other where there is no appropriate account. You should examine different configurations of the search criteria: Search for the first account with a strictly positive balance; or with a strictly positive balance that does not exceed $100. Check whether you can, using the FindAll method, find all accounts with a specific balance and name. Also, does this method properly find all accounts that are, for example, related to credit cards and short term deposits (use the Name property to determine the account type)? Similarly to the test of the FindAll method, check whether the RemoveAll method meets the given description and works correctly in regard to the input criteria. Make sure you test how these three methods work when the respective input criteria is null; that is, do they throw the expected exception? 5. To test the Min and the Max methods, you first must make objects of the Account class comparable. Specifically, you need to implement a mechanism that compares two elements of the Account type, and thus provides a default way to determine the relation between these elements. Fortunately, .NET Framework has a standard way to realize this approach: The Account class must implement the special IComparable interface. The IComparable interface imposes implementation of the compulsory CompareTo(T other) method that compares this (current) element to the other element (given as the input argument) and returns an integer value that is less than zero, when this instance (object) is considered smaller than the other object specified in the input of the Compare to method; zero, when this instance (object) is considered equal to the other; and Ogreater than zero, when this instance (object) is considered greater than the other object. To get details on how to apply the IComparable interface, you will need to do some extra research. It is important to note that in regard to the Account class, the generic type T is a placeholder that is to as an actual class. Specifically, you will need to modify the Account class be replaced by the Accoun and implement the IComparable interface along with its underlying CompareTo(Account other) method. Then, the CompareTo(Account other) must return

Step by Step Solution

3.43 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

Heres a stepbystep guide to help you with the implementation and testing Task 32 Account Class Modification Modify the Account class to include the Ba... 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

Auditing A Practical Approach

Authors: Robyn Moroney, Fiona Campbell, Jane Hamilton

4th Edition

0730382648, 978-0730382645

More Books

Students also viewed these Programming questions

Question

Solve for P(x 4). Express answer in 2 decimal places.

Answered: 1 week ago