Write a unit test for addinventory(). call redsweater.addinventory() with parameter sweatershipment. print the shown error if th e subsequent quantity is incorrect. sample output for failed unit test given initial quantity is 10 and sweatershipment is 50: beginning tests. unit test failed: addinventory() tests complete. note: unit test failed is preceded by 3 spaces.
1 answer:
<span>#include <iostream>
using namespace std;
class InventoryTag {
public:
InventoryTag();
int getQuantityRemaining() const;
void addInventory(int numItems);
private:
int quantityRemaining;
};
InventoryTag::InventoryTag() {
quantityRemaining = 0;
}
int InventoryTag::getQuantityRemaining() const {
return quantityRemaining;
}
void InventoryTag::addInventory(int numItems) {
if (numItems > 10) {
quantityRemaining = quantityRemaining + numItems;
}
}
int main() {
InventoryTag redSweater;
int sweaterShipment = 0;
int sweaterInventoryBefore = 0;
sweaterInventoryBefore = redSweater.getQuantityRemaining();
sweaterShipment = 25;
cout << "Beginning tests." << endl;
// FIXME add unit test for addInventory
/* Your solution goes here */
cout << "Tests complete." << endl;
return 0;
}</span>
You might be interested in
The answer is a because 552.50 x .12 is 66.30. 66.30 minus 552.50 is 486.50 and that divided by 7 is 69.45
Answer:
I'm fairly positive the answer is 90 degrees.
9514 1404 393
Answer:
r = ±√47
Step-by-step explanation:
-7r^2 = -329 . . . . given
r^2 = 47 . . . . . divide both sides by -7 (multiplication property of equality)
r = ±√47 . . . . square root both sides (square root property of equality)
Answer:
Expanded Notation Form:
97,367 =
90,000
+ 7,000
+ 300
+ 60
+ 7
Expanded Factors Form:
97,367 =
9 × 10,000
+ 7 × 1,000
+ 3 × 100
+ 6 × 10
+ 7 × 1
Expanded Exponential Form:
97,367 =
9 × 104
+ 7 × 103
+ 3 × 102
+ 6 × 101
+ 7 × 100