Recent content by EvanET

  1. E

    C/C++ How to Write a Copy Assignment Operator for CarCounter in C++?

    I am given a prompt to: Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *this. #include <iostream> using namespace std; class CarCounter { public: CarCounter(); CarCounter& operator=(const CarCounter&...
  2. E

    C/C++ [C++] Unit testing of a class HELP

    if i use the code it doesn't work, i took out the assert, the code ran but here are my results: [PASS]Inventory is 0, shipment is 25. Testing that quantityRemaining was updated to 25. Your value: 25 [PASS]Testing with sweaterShipment of 25. addInventory updates quantityRemaining. Your output...
  3. E

    C/C++ [C++] Unit testing of a class HELP

    I'm given the code: #include <iostream> using namespace std; class InventoryTag { public: InventoryTag(); int getQuantityRemaining() const; void addInventory(int numItems); private: int quantityRemaining; }; InventoryTag::InventoryTag() { quantityRemaining = 0; } int...
  4. E

    C/C++ Need help coding with assigning the size of a Vector (C++)

    WOW(Headbang) i just had it backwards this whole time (Giggle) i previously tried it as: sensorReadings.size() = currentSize; i guess i just need to read it right to left, so to speak.
  5. E

    C/C++ Need help coding with assigning the size of a Vector (C++)

    Hmmm.. ok. sensorReadings.size() = currentSize; so like that?
  6. E

    C/C++ Find Min/Max Miles in milesTracker Program

    on your second for statement make this correction: for(j=0;j<NUM_COLS;++j) this is what it said before: for(j=0;i<NUM_COLS;++j) all i changed was the i and made it j, this completed the code and ran everything.
  7. E

    C/C++ Need help coding with assigning the size of a Vector (C++)

    I am prompted to: Assign the size of vector sensorReadings to currentSize. Assigning is the double equal sign (==) but i get an extremely long error i am given this much code: #include <iostream> #include <vector> using namespace std; int main() { vector<int> sensorReadings(4); int...
  8. E

    C/C++ How to Properly Resize and Populate a Vector in C++ Without Using push_back?

    Resize vector countDown to have newSize elements. Populate the vector with integers {newSize, newSize - 1, ..., 1}. Ex: If newSize = 3, then countDown = {3, 2, 1}, and the sample program outputs: 3 2 1 Go! **I want to do this WITHOUT push_back** #include <iostream> #include <vector> using...
Back
Top