Write a unit test for addinventory(). call redsweater.addinventory() with parameter sweatershipment. print the shown error if the 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.

Answers

Answer 1
Final answer:

A unit test for the function addInventory() can be written in JavaScript using Jest. The test checks that the quantity of red sweaters increases correctly after calling addInventory(). If the test fails, an error message will be shown.

Explanation:

Based on the information given, you can create a unit test in many programming languages. Here we are going to illustrate with JavaScript and use the Jest testing framework.

Firstly, let's name the unit test file as redSweater.test.js. In this file, we call the addInventory() of the redSweater object with sweaterShipment as parameter.  Note that addInventory() is a method that increases the quantity of red sweaters in inventory by a certain amount provided by sweaterShipment.

Here is a sample unit test for your needs:

const redSweater = require('./redSweater'); // path to your redSweater.js file

test('addInventory() unit test', () => {

let initialQty = 10;

redSweater.qty = initialQty;

let shipmentQty = 50;

redSweater.addInventory(shipmentQty);

expect(redSweater.qty).toBe(initialQty + shipmentQty);

});

This script tests that the quantity of red sweaters increases correctly after calling the addInventory() method. If the quantity is not correct after the method call, the test will fail and show an error message.

Learn more about Unit Testing here:

https://brainly.com/question/32106174

#SPJ12


Related Questions

A group of friends are going to a cottage for the weekend. The scale used is 1 : 250,000. The distance measures 8.5cm on the map. What is the actual distance

Answers

The scale 1:250,000 indicates that 1 centimeters in the map represent 250,000 centimeters in real distance.
So, the calculation for the actual distance would be:

8.5 cm x 250,000 = 2,125,000 cm

since 1 km = 100,000 cm

2,125,000 cm =  21,25 Km

which number line represents the solutions to |-2x|=4?

Answers

the answer would be -2 because -2 times -2 equals 4 because two negative equals a positive and a negative and a positive equals a negative.REMEBER THAT
Solve for x by simplifying both sides of the equation, then isolating the variable.

x=-2,2

Which is the graph of the function f(x) = x2 + 2x – 6? Mark this and return

Answers

Vertex: ( -1, -7 )

Focus: ( -1, -27/4 )

Axis of Symmetry: x = -1

Directrix: y = -29/4


X | Y
———
-3| -3
-2| -6
-1 | -7
0 | -6
1 | -3
Final answer:

The graph of the function f(x) = x² + 2x − 6 is an upward-opening parabola with the vertex at (-1, -7) and a y-intercept at (0, -6). There are no asymptotes for this quadratic function.

Explanation:

To find the graph of the function f(x) = x² + 2x − 6, we need to look at the characteristics of this quadratic equation. This is a parabola that opens upward because the coefficient of is positive. We can find the vertex of this parabola by using the formula -b/2a for the x-coordinate of the vertex.

Here, a = 1 and b = 2. Applying the formula, we get the x-coordinate of the vertex as -b/2a = -2/(2×1) = -1. Now, we plug this value back into the function to get the y-coordinate of the vertex: f(-1) = (-1)² + 2(-1) − 6 = 1 - 2 - 6 = -7. Therefore, the vertex of the parabola is at (-1, -7). The parabola will intersect the y-axis when x = 0, which gives us the y-intercept f(0) = -6. No asymptotes are present in this quadratic function.

The graph of f(x) is symmetrical about the line x = -1 and has a y-intercept at (0, -6). The vertex at (-1, -7) is the lowest point on the graph since the parabola opens upwards. Thus, we are looking for a graph with these characteristics to represent the function f(x) = x² + 2x − 6.

14.4% of what is 10.44

Answers

Convert 14.4% into the decimal fraction 0.144.  Then 0.144x = 10.44.

Dividing both sides by 0.144, x = 10.44/0.144 = 72.5.

The "what?" is 72.5.

Please answer ASAP: Determine which of the following situations can be modeled by the ratio 7/2. Select all situations that apply
For every twenty-eight cats, there are 4 dogs
Sara runs an average of fourteen miles every four days.
An online clothing store charges $7.50 to ship ten clothing items
A recipe calls for 3 cups of flour for every 1 cup of sugar.
Bottled water is on sale this week for a rate of $1.50 for two bottles

Answers

the only one that applies is:

Sara runs 14 miles every 4 days = 7 miles every 2 days = 7/2


Which is the most accurate way to estimate 23% of 70?

Answers

It would be what is 20% of 70. x = 20/100 x 70 = 14
20% of 70 is 14
Hi there! The most accurate way to estimate 23% of 70 is to write and solve a proportion. You would write it out as x/70 = 23/100, because we’re looking for the number that is 23% of 70. Cross multiply the values to get 1,610 = 100x. Divide each side by 100 to isolate the “x”. When you do, you get x = 16.1. There. 23% of 70 is 16.1.

what is 62.19 x 32.5

Answers

you have to multilpy them . answer would be 2021.175 
62.19x32.5=2,021.275

Tiesha enjoys reading in her spare time. She reads 4 pages every 1/10 of an hour. The proportional relationship between the number of pages (p) and the number of hours (h) is represented by the equation ______. Write the equation in standard form with a constant of proportionality greater than 1.

Answers

The equation in standard form with a constant of proportionality greater than 1 is p=40h.

Given that, Tiesha enjoys reading in her spare time. She reads 4 pages every 1/10 of an hour.

What is the proportional relationship?

Proportional relationships are relationships between two variables where their ratios are equivalent. Another way to think about them is that, in a proportional relationship, one variable is always a constant value time the other. That constant is known as the "constant of proportionality".

Now, p∝h

⇒p=kh-----(i)

So, 4∝1/10

⇒4=k/10

⇒k=40-----(ii)

Substitute equation (ii) in equation (i).

That is, p=40h

Therefore, the equation in standard form with a constant of proportionality greater than 1 is p=40h.

To learn more about the proportional relationship visit:

https://brainly.com/question/12917806.

#SPJ2

Anyone knows??? And like to help

Answers

6a.
Let the price of a ticket be t.
t - 2 = 7

6b.
The number of gallons is g.
7 = 2g

6c.
Sorry, but I don't know what problem 5 was, so I can't answer.

On Anne's bicycle, the ratio of pedal turns to rear- wheel turns in second gear is 4 to 7. If her rear wheel turns 875 times per mile, how many times does she turn the pedal in one mile? HINT: Set up and solve as a proportion to find x.

Answers

4 / 7 = x / 875....4 pedal to 7 rear = x pedal to 875 rear
cross multiply
(7)(x) = (4)(875)
7x = 3500
x = 3500/7
x = 500 <== she turns the pedal 500 times in 1 mile

Which of these story problem describes the sum 19 + (-12)? Check all that apply. Show your work to justify your answer.

Answers

-19 + (-12) = 7

Remove Parentheses  
( -a ) = -a 

= 19 - 12
Subtract The Numbers 
19-12 = 7

Which of the following numbers are divisible by 2? 74 , 296, 1110, 148, 370, 666, 9324, 111, 37, 555 , or 333?

Answers

All the even numbers r divisible by 2.
Which means the answer is 74, 296, 1110, 148, 370, 666, 9324.

How many feet of fencing is needed to fence in a 130 ft by 225 ft area?

Answers

you need 710 ft of fencing.
So you just want to find the perimeter first.

Perimeter is:

2l + 2w

If l equals to length and w width.

So,

2 * 130 + 2 * 225

260 + 450

710

So the perimeter is 710 feet, so you need 710 feet to fence in a 130 ft by 225 ft area.

Gomez runs a small pottery firm. he hires one helper at $15,000 per year, pays annual rent of $6,500 for his shop, and spends $23,000 per year on materials. he has $40,000 of his own funds invested in equipment (pottery wheels, kilns, and so forth) that could earn him $6,000 per year if alternatively invested. he has been offered $20,500 per year to work as a potter for a competitor. he estimates his entrepreneurial talents are worth $5,000 per year (input cost for organizing resources). total annual revenue from pottery sales is $82,000. calculate the accounting profit and the economic profit for gomez's pottery firm.

Answers

Final answer:

The accounting profit for Gomez's pottery firm is $37,500, calculated by subtracting explicit costs from total revenue. The economic profit is $6,000, figured out by subtracting both explicit costs and implicit costs from total revenue.

Explanation:

To calculate the accounting profit for Gomez's pottery firm, we subtract all explicit costs (money spent) from the total revenue. In this case, we subtract the salary of the helper ($15,000), the rent of the shop ($6,500), and the amount spent on materials ($23,000) from the total annual revenue from pottery sales ($82,000). Therefore, the accounting profit is $82,000 - $15,000 - $6,500 - $23,000 = $37,500.

On the other hand, to obtain the economic profit, we need to also subtract implicit costs, which are the opportunity costs of using the resources in one way rather than the next best alternative way. Gomez could have made $6,000 by investing his own $40,000 elsewhere, and he could have earned $20,500 by working for a competitor, so these are both implicit costs. Additionally, he estimates his entrepreneurial talents to be worth $5,000. Therefore, "the economic profit is $37,500 (accounting profit) - $6,000 (returns from alternative investment) -  $20,500 (salary from competitor) - $5,000 (value of his entrepreneurial talents) = $6,000".

Learn more about Accounting and Economic Profit here:

https://brainly.com/question/32461520

#SPJ6

Find the absolute value of the jacobian, ∣∣∂(x,y)∂(s,t)∣∣, for the change of variables given by x=s+5t,y=3s+8t

Answers

[tex]\left\|\dfrac{\partial(x,y)}{\partial(s,t)}\right\|=\left|\begin{vmatrix}\dfrac{\partial x}{\partial s}&\dfrac{\partial x}{\partial t}\\\\\dfrac{\partial y}{\partial s}&\dfrac{\partial y}{\partial t}\end{vmatrix}\right|=\left|\begin{vmatrix}1&5\\3&8\end{vmatrix}\right|=|-7|=7[/tex]

Opening up the monthly cell phone bill can be alarming due to the uncertainty of the bill. suppose the amount of minutes used per month is distributed normally with a mean of 700 minutes and a standard deviation of 120 minutes. what is the probability that more than 940 minutes were used?

Answers

Given the mean of 700 min. and the std. dev. of 120 min., we need to find the z-score for 940 minutes and then the area under the std. normal curve to the right of that z-score.
                                                        940 - 700
The applicable z score here is z = ----------------- = 2.  What is the area under
                                                              120
the curve and to the right of 2 std. deviations from the mean?

You could find the answer from a table of z-scores, or you could take advantage of the empirical rule.  The empirical rule states that 95% of the normally distributed data set lies within 2 std. dev. of the mean.

The area to the right of z=2 is 0.5 (half the area under the std. normal curve) less 0.95/2, that is, less 0.475.

Subtracting 0.475 from 0.500 yields 0.025 (answer).  2.5% of the time, the monthly phone bill will exceed 940, or 2 std. dev. above the mean.

Answer:

the required probability = 0.25

Step-by-step explanation:

Mean = 700 minutes , Standard Deviation = 120 minutes

To find : the probability that more than 940 minutes were used.

Solution : First find the z-score for 940 minutes and then find the area under the curve to the right of associated standard deviations from the mean.

[tex]z-score=\frac{\mu_2-\mu_1}{\sigma}\\\\\mu_1=700,\mu_2=940,\sigma=120\\\\\implies z-score=\frac{940-700}{120}\\\\\implies z-score=2[/tex]

Now, calculate the area under the curve to the right of 2 standard deviations from the mean.

Take confidence level to be 95%.

The area to the right of 2 standard deviations is 0.5 that is half the area under the standard normal curve.

[tex]\implies Area < \frac{0.95}{2}\\\\\implies Area<0.475[/tex]

Now, to find the probability that more than 940 minutes were used = 0.5 - 0.475 = 0.25

Hence, the required probability = 0.25

Which equation represents a direct variation? y = 2x y = x + 4 y = x y =

Answers

The first equation is a direct variation. This type of equation has a form that is "y = kx," in which k is the constant. Changing both sides by a common multiple will still lead to the equation being evaluated as true, since the values will both increase by that multiple.

Liliana takes 4 breaths per 10 seconds during yoga. At this rate, about how many breaths would Liliana Take in 2 minutes of yoga?

Answers

There are 60 seconds in a minute so, 10 seconds is 1/6 of a minute. Therefore, 4 times 12 equals 48 breaths.

a pile of newspapers in the recycling bin was 12 1/4 inches high. each week the height of the pile increases by 4 5/8 inches. what is the height of the pile after 4 weeks

Answers

4 5/8*4=20 1/2  12 1/4+20 1/2=32 3/4

If f(x)=8x and g(x)=2x+1, find(f•g)(x).

A) 16x+1
B) 10x+1
C) 16x+8
D) 16x^2+8x

Answers

(F of g)(x) = f(2x+1) = 8*(2x+1) = 16x + 8 Choice B
(f•g)(x) = 8x * (2x+1) = 8x(2x + 1)
8x(2x + 1)
16x^2 + 8x
 
 (f•g)(x) = 16x^2 + 8x

What is the simplified form of the following expression

Answers

Final answer:

To simplify the given expression, factor out the common factors from the denominator and rewrite the expression using the factored form.

Explanation:

To simplify the given expression, we first need to simplify the denominator. This can be done by factoring out a common factor of 4 from each term:

(4a + 2)(2a - 3)

Next, we can rewrite the expression using the factored form:

1 / (4a + 2)(2a - 3)

This is the simplified form of the given expression.

The answer is c. [tex]$\frac{\sqrt[3]{20 x}}{5}$[/tex]

Separate the cube root: We can break down the cube root of a fraction into the cube root of the numerator divided by the cube root of the denominator:

[tex]\sqrt[3]{\frac{4 x}{5}} = \frac{\sqrt[3]{4 x}}{\sqrt[3]{5}}[/tex]

Simplify the cube root of 5: Since 5 is a perfect cube (5 = 1 * 5 * 5), its cube root is simply 5:

[tex]\frac{\sqrt[3]{4 x}}{\sqrt[3]{5}} = \frac{\sqrt[3]{4 x}}{5}[/tex]

Rationalize the denominator: To make the expression look more simplified, we can eliminate the cube root in the denominator. We do this by multiplying both the numerator and denominator by the cube root of 5:

[tex]\frac{\sqrt[3]{4 x}}{5} \times \frac{\sqrt[3]{5}}{\sqrt[3]{5}} = \frac{\sqrt[3]{4 x} \times \sqrt[3]{5}}{5 \times \sqrt[3]{5}}[/tex]

This simplifies to:

[tex]\frac{\sqrt[3]{20 x}}{5}[/tex]

Therefore, the simplified form of the expression is [tex]$\frac{\sqrt[3]{20 x}}{5}$[/tex].

Complete Question:

What is the simplified form of the following expression?

[tex]\sqrt[3]{\frac{4 x}{5}}[/tex]

a. [tex]$\frac{\sqrt[3]{4 x}}{5}$[/tex]

b. [tex]$\frac{\sqrt[3]{20 x}}{5}$[/tex]

c. [tex]$\frac{\sqrt[3]{100 x}}{5}$[/tex]

d. [tex]$\frac{\sqrt[3]{100 x}}{125}$[/tex]

Write an equation of the line passing through (-5,5) and having slope -6. Guve the answer in slope-intercept form.

Answers

Passes through (-5, 5) & has a slope of -6.

We want the answer in slope-intercept form.

** Remember! Slope-intercept form : y=mx+b where m=slope, b=y-intercept.

Simply plug everything in :)

y = mx + b

y = (-6)x + (5)

Simplify.

y = -6x + 5

~Hope I helped!~

Allison practices her violin for at least 12 hours per week. She practices for three fourths of an hour each session. If Allison has already practiced 3 hours this week, how many more sessions remain for her to meet or exceed her weekly practice goal?

Answers

If Allison practices for 3/4 of an hour each section that means she practices for 45 minutes each session because .75 or 3/4 of 60 mins is 45 mins. Then calculate how many hours she has left for the week which is 9 hours. Next calculate how many minutes are in 9 hours which is 540 mins. Then divide 45 by 540 and your answer should be at least 12 sessions.

Andrew has 10 more goldfish than todd.together they have 50 goldfish.how many goldfish each boy have?

Answers

Andrew has 30
Todd has 20

Answer:

Andrew has 30 goldfish and Todd has 10 goldfish

Step-by-step explanation:

Lets call A the number of goldfish Andrew has and T the number of goldfish Todd has.

Andrew has 10 more goldfish than Todd:

A = T + 10

Together they have 50 goldfish:

A + T = 50

Lets replace A = (T + 10) in the las equation:

T + 10 + T = 50

Lets solve T in this equation:

2T + 10 -10 = 50 -10

2T /2 = 40 /2

T = 20

Todd has 20 goldfish

Now lets calculate A = T + 10 = 20 + 10 = 30

Andrew has 30 goldfish

Mr. and mrs. harris have six kids aged 5, 6, 8, 10, 16, and 19. the median age of the harris children is _____.

Answers

I think the median age is 9

Answer:

The median age is 9 years old

Step-by-step explanation:

We can find the median by getting the average of the center number of the middle two numbers

8 and 10 are the two middle numbers in this scenario.  8 + 10 = 18

18/2 = 9

There were​ 36,000 people at a ballgame in los angeles. the​ day's receipts from​ $12 reserved seats and​ $6 general-admission seats were​ $258,000 how many of each type of seat were​ sold?

Answers

There would be 9,000 tickets sold at the $12 price point and 25,000 tickets sold at the $6 price. (25,000 x 6 = $150,000. 9,000 x $12 = $108,000. $150,000 + $108,000 = $258,000).

which of the following three dimensional objects has Rotational symmetry about a line A.a car. B.a set of rectangular stairs. C. a rolling pin. D.a stapler

Answers

Answer:

C. a rolling pin.

Step-by-step explanation:

A rolling pin has a cylindric shape, which is a revolution surface. This means that the rolling pin is symmetric about a line or axis, therefore, it can be rotated around it.

Final answer:

A rolling pin has rotational symmetry about its longitudinal axis, making it the correct answer, while a car, a set of rectangular stairs, and a stapler do not demonstrate this symmetry.

Explanation:

The question relates to the concept of rotational symmetry in three-dimensional objects, which is a part of the study of Physics, specifically dealing with rotational motion. The answer to which of the listed objects has rotational symmetry about a line is C. a rolling pin. A rolling pin has rotational symmetry because when it rotates about its longitudinal axis, its appearance is unchanged after a certain angle of rotation. In contrast, objects like a car, a set of rectangular stairs, and a stapler do not exhibit this symmetry because their appearance changes visibly when they are rotated about any line.

a rectangle has a side length 2x+9 and side width x. If the perimeter is 36 cm, what is the value of x?

Answers

2(2x + 9) + 2(x) = 36

4x + 18 + 2x = 36

Combine like terms.

6x + 18 = 36

Subtract 18 from both sides.

6x = 18

Divide 6 on both sides.

x = 3

Hope this helps!

It takes a boat 2 hours to travel 22 miles downstream and 4 hours to travel 20 miles upstream. What is the speed of the boat in still water?

Answers

Let  b= speed of boat in still water
Let  c= speed of current
Upstream
Speed is ; b-c
d u=(b-c)* t u

Downstream
speed is ; b+c
d d=(b+c)*t d

given:
d u=18
t u=3
d d=24
t d=2


------------------
(1) 18=(b-c)*3
(2) 24=(b+c)*2
and
(1) 18=3b-3c
(2) 24=2b+c
Multiply both sides of (1) by 2
Multiply both sides of (2) by 3

(1) 
(2) 
Add (1) and (2)


And, from (1),
18=3*9-3c
3c=27-18
3c=9
c=3
The speed of the boat in still water is 9 mi/hr
The speed of the current is 3 mi/hr
check:
(1) 18=(9-3)*3
(2) 24=(9+3)*2
and
(1) 18=16*3
18=18
(2) 24=24

Which function represents the graph of f(x)=|2x| after it is translated 5 units to the left?



g(x)=|2(x−5)|

g(x)=|2x+5|

g(x)=|2x−5|

g(x)=|2(x+5)|

Answers

Answer:

g(x) = |2(x+5)|

Step-by-step explanation:

To translate a function left 5 units, replace x with (x+5). In this function, that means

  2x ⇒ 2(x+5) . . . . . matches the last choice

Other Questions
You can buy 4 pounds of peaches for $5.96. What do 4 1/2 pounds of peaches cost? El verbo esperar es _____.to waitto teach As he lays dying on the floor of the senate in Shakespeare's play Julius Caesar, Caesar says these words.Et tu, Brute? [And you, Brutus?]What is the most likely reason that Shakespeare has Caesar say these words?A.)Brutus was Caesars friend but has betrayed him.B.)Brutus tries to save Caesar from the assassination attempt.C.)Caesar wants Brutus to succeed him as the ruler of Rome. How many colonies sent people to the stamp act Congress? Why are political speeches biased? Two similar triangles are shown below: Which two sets of angles are corresponding angles? w and v; x and y w and y; x and v w and z; x and v w and z; x and y The Mexican Cession included a large tract of territory in the do humans need photosynthesis to survive? Ou anticipate difficulty in establishing rapport with mr. warren. this is because individuals with personality disorders: Which of the following sentencesmostclearly uses problem-solution organization?A.The collapse of the housing market was by far the biggest factor in the recent recession.B.Do you have problems with mosquitoes and gnats? Fabulous Exterminators can help!C.Splitting the Roman Empire into two parts helped the eastern territories live on.D.We've gathered at this conference to discuss three things: poverty, war, and disease. In the chemical formula 2NO2 how many atoms ot oxygen are there Makes the goal real"Which goal-setting step is described by this sentence?ANSWER: Write it down Which sentence is an example of chronological structure in "The City Without Us"? A. Unheated buildings would result in a destructive freeze-thaw cycle. B. Without daily pumping, Manhattan's subway tunnels would be flooded. C. After 20 years, rusted beams in buildings will cause them to start collapsing. D. If flooding were to go unchecked, steel support beams in buildings would rust. Which type of account typically has very high liquidity, low or no interest, and low minimum balance? How might a behavior geneticist explain the statistically significant finding that television watching is heritable? Why is emotional intimacy important to close relationships A triangular table has angles with measures in the ratio 7:9:4. What is the measure of the smallest angle? What was the purpose of the Sherman antitrust act?A. To raise taxes on large corporations B. To protect workers rights to strikeC. To determine how much steel should be produced each year D. To prevent the creation of monopolies What is the atomic number of the atom shown? Secular compositions that flourished in italy and england and allowed composers to write more experimentally Steam Workshop Downloader