1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
muminat
4 years ago
5

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.
Mathematics
1 answer:
Katena32 [7]4 years ago
5 0
<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
What is the measure of the angle
lozanna [386]

Answer:

140 degree

Step-by-step explanation:

You go anticlockwise, starting from the 0.

8 0
3 years ago
Nina walked 15 yards to Paul's house. They then went hiking. Which rule shows how many yards Nina walks for every yard Paul walk
denis-greek [22]
N= x+15 where n = nina, x = the amount hiked together and the 15 is how much she already walked.
4 0
3 years ago
Read 2 more answers
Find the area of the figure.
Hoochie [10]

Answer:

384 cm

Step-by-step explanation:

7.5 x 24 = 180

8.5 + 7.5 = 16

16 x 24 = 384

5 0
3 years ago
Given the Arithmetic series A1+A2+A3+A4 7 + 11 + 15 + 19 + . . . + 91 What is the value of sum?
aivan3 [116]

Answer:

The value of the sum is 1078

Step-by-step explanation:

* Lets revise how to find the sum of the arithmetic series

- In the arithmetic series there is a constant difference between each

 two consecutive terms

- Ex:

# 4 , 9 , 14 , 19 , 24 , .......... (+ 5)

# 25 , 15 , 5 , -5 , -15 , .......... (-10)

- So if the first term is a and the constant difference between each two

  consecutive terms is d, then

  U1 = a , U2 = a + d , U3 = a + 2d , U4 = a + 3d , ..........

- Then the nth term is Un = a + (n - 1)d

- The sum of n terms is Sn = n/2[a + L] , where L is the last term in

 the series

* Lets solve the problem

∵ The arithmetic series is 7 + 11 + 15 + 19 + ......................... + 91

∴ The first term (a) is 7

∴ The last term is (L) 91

- Lets find the constant difference

∵ 11 - 7 = 4 and 15 - 11 = 4

∴ The constant difference (d) is 4

- Lets find the sum of the series from 7 to 91

∵ Sn = n/2[a + L]

∵ a = 7 and L = 91

∴ Sn = n/2[7 + 91]

- We need to know how many terms in the series

∵ L is the last term and equals 91 lets find its position in the series

∵ Un = a + (n - 1)d

∵ a = 7 , d = 4 and Un = 91

∴ 91 = 7 + (n - 1)(4) ⇒ subtract 7 from both sides

∴ 84 = (n - 1)(4) ⇒ divide both sides by 4

∴ 21 = n - 1 ⇒ add 1 to both sides

∴ n = 22

∴ The number of the terms in the series is 22

- Lets find the sum of the 22 terms (S22)

∴ S22 = 22/2[7 + 91]

∴S22 = 11[98] = 1078

* The value of the sum is 1078

4 0
3 years ago
If a triangle is 12 inches high and has a 20 inch long hypotenuse then how wide is it?
Ber [7]

Answer:

The triangle should be 16 inches wide.

Step-by-step explanation:

\text {Use the Pythagorean Theorem to solve for the leg.}\\a^2 + b^2 =c^2

What we know:

  • One of the legs measures 12 inches.
  • The hypotenuse is 20 inches.

We need to solve for b. Solving for a while b is 12 would also be acceptable.

12^2 + b^2 = 20^2  \text {  OR  }   a^2 +12^2=20^2

We will use the first equation.

12^2 + b^2 = 20^2\\12 * 12 = 144\\20 * 20 = 400\\\\\boxed {144 + b^2 = 400}

\text {Subtraction property of equality: }\\144-144+ b^2 = 400-144\\\boxed {b^2 = 256}\\\\\text {Take the square root of 256: }\\\sqrt{256}=\sqrt{b^2} \boxed {16 = b}

The triangle should be 16 inches wide.

3 0
3 years ago
Other questions:
  • Write a two-column proof
    6·1 answer
  • The math club needs to raise more than $552. $.50 for a trip to state competition. The club has raise 12% of the funds which is
    13·1 answer
  • There are 100 books in the libary. There are non fiction and fiction books write the fraction of the books that are fiction
    9·1 answer
  • How many solutions does this system have?<br> 3x+y=2<br> 4y=12-12x
    13·1 answer
  • Find the equation of the circle that has a diameter with endpoints located at (-5,-3) and (-11,-3)
    14·1 answer
  • Brianna brought her car for $15,640 it is expected to depreciate and average of 50% each year during the first seven years what
    13·2 answers
  • A college football fan is interested in estimating the average pass efficiency rating for quarterbacks in the NCAA Division I Fo
    5·1 answer
  • What's the probability you will flip 3 coins in a row and they all land on HEADS?
    9·1 answer
  • Take a look at picture please!!!!! 10 points!! Option d is 1/4
    7·1 answer
  • BUILD PERSEVERANCE Find the values of x and y. List your answers in ascending order.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!