Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following class: #rfndef BIDCOLLECTION-H #define BiDCOLLECTION.H #i

ID: 3595431 • Letter: C

Question

Consider the following class: #rfndef BIDCOLLECTION-H #define BiDCOLLECTION.H #include "bids.h" class BidCollection ( int MaxSize: int size Bid* elements; // array of bids public: * Create a collection capable of holding the indicated number of bids BidCollection (int MaxBids 1000 BidCollection (const BidCollection& -BidCollection O: BidCollection& operator-(const BidCollections // Access to attributes int getMaxsize0 const (return MaxSize:) int getsizeo const (return size:) Il Access to individual elements const Bid& getint index) const [return elements[indexj) II Collection operations void addinTimeOrder (const Bid& value: /I Adds this bid into a position such that I all bids are ordered by the time the bid was placed //Pre: getsize0

Explanation / Answer

Hi,
Unit test testing involves only those modules/functions that are important to the performance of the code.
In the given code we have the following methods
1.operator ==(const BidCollection&) const(equality operator)
2.addInTimeOrder
3.remove
4.operator =(const BidCollection&) const(assignment operator)
We can write unit tests for the above 2 methods and they are working correctly to assess the correctness of code

Thumbs up if this was helpful , otherwise let me know in comments

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote