Question

In: Computer Science

Task 2 We are producing two types of products, product A and product B. Product A...

Task 2

We are producing two types of products, product A and product B. Product A is defective if the weight is greater than 10 lbs. Product B is defective if the weight is greater than 15 lbs. For a given product, we know its product_type and its weight. Design a program to screen out defective products. Starting the program with variable definition:

product_type = 'xxx'

weight = xxx

Hint: You need to figure out the product type first, and then check if the product is defective based on the weight. You may use a nested if statement like the following:

if product is A:

     if product weight > 10:

          the product is defective

else:

     if product weight >15:

          the product is defective

But you need to translate the English into Python codes.

As a challenge, you may also try a one-step if statement. such as :

if some condition is met:

     the product is defective

else:

     the product is normal

And the key is the bolded “some condition”.

Solutions

Expert Solution

product_type = input ("Enter Product Type ")

product_weight = int(input("Enter Product Weight in lbs "))

if product_type is "A":

if (product_weight>10):

print("the product is defective")

else:

print("the product is normal")


else:

if (product_weight > 15):

print("the product is defective")

else:

print("the product is normal")

=================================================================================================

For indentation refer this image as editor disturbs it.


Related Solutions

Command Company produces two types of electronic products, Product A and Product B. Electronic gaming products...
Command Company produces two types of electronic products, Product A and Product B. Electronic gaming products are hot products now and either product A or product b could be sold to keep the manufacturing facility operating a full capacity. The constraint is direct labour hours and it is insufficient to meet the combined demand for both.   Both products are processed through the same production departments. The relevant information is as follows: Product A Product B Sales Price $ $250 $140...
2.) A company manufactures two types of products, A and B. The unit revenues are $2...
2.) A company manufactures two types of products, A and B. The unit revenues are $2 and $3, respectively. Two raw materials M1 and M2, used in the manufacture of the two products have daily availabilities of 4 and 6 units, respectively. One unit of A uses 1 unit of M1 and 1 unit of M2, and one unit of B uses 1 unit of M1 and 2 units of M2. a) Formulate a linear programming model and obtain the...
) 123 Corporation sells two products Product A and product B which sell in a 3:2...
) 123 Corporation sells two products Product A and product B which sell in a 3:2 ratio. Product A has a variable cost of $65 per unit and sells for $70. 123 Corporation has fixed expenses of $140,000. When 123 corporations sells 25,000 units they have an operating income of $20,000. a) What is the contribution margin on Product B? ANS: b) Assuming variables costs of $80, what is the sales price of product B? Ans: c) Prepare a contribution...
The following information is for X Company's two products, A and B: Product A Product B...
The following information is for X Company's two products, A and B: Product A Product B Revenue $93,000 $90,000 Total contribution margin 39,990 41,400 Total fixed costs 25,750 57,620 Profit $14,240 $-16,220 $13,648 of Product A's fixed costs are avoidable; $29,962 of Product B's fixed costs are avoidable. X Company plans to drop Product B since it shows a loss and increase sales of Product A by $34,800. Accompanying the sales increase will be a fixed cost increase of $5,000....
The following information is for X Company's two products, A and B: Product A Product B...
The following information is for X Company's two products, A and B: Product A Product B Revenue $93,000    $90,000    Total contribution margin 39,990    37,800    Total fixed costs 30,430    55,990    Profit $9,560    $-18,190    $15,215 of Product A's fixed costs are avoidable; $33,034 of Product B's fixed costs are avoidable. X Company plans to drop Product B since it shows a loss and increase sales of Product A by $29,600. Accompanying the sales increase will be a fixed cost increase of $4,800....
1.Describe the two types of product classifications. 2.Define the four types of consumer products. 3.Define a...
1.Describe the two types of product classifications. 2.Define the four types of consumer products. 3.Define a product item, a product line, and a product mix. 4.Describe the two key reasons why a firm might make adjustments to a product item, product line, or product mix. 5.Define the four primary adjustments a firm might make when adjusting product items, product lines, or product mixes. -Principles of Marketing.
Reliable Supply Company sells only two products, Product A and Product B. Product A Product B...
Reliable Supply Company sells only two products, Product A and Product B. Product A Product B Total Selling price $35 $58 Variable cost per unit $27 $42 Total fixed costs $395,000 Reliable Supply sells 4 units of Product A for each 3 units it sells of Product B. Reliable Supply has a tax rate of 20%. Required: a.   What is the breakeven point in units for each product, assuming the sales mix is 4 units of Product A for each...
Norman Goods sells only two products, Product A and Product B. Product A Product B Total...
Norman Goods sells only two products, Product A and Product B. Product A Product B Total Selling price $50 $80 Variable cost per unit $33 $48 Total fixed costs $550,000 Norman Goods sells three units of Product A for each two units it sells of Product B. Norman Goods has a tax rate of 20%. Required: a.     What is the breakeven point in units for each product, assuming the sales mix is 3 units of Product A for each two...
A company sells two products, A and B. Product A Product B Produced and sold 8.000...
A company sells two products, A and B. Product A Product B Produced and sold 8.000 units 16.000 units Sale price per unit 65 52 Variable cost per unit 35 30 Fixed cost per unit 15 15 Fixed cost is divided in a traditional way, based on the produced quantity. The company started to design a new product C to replace product B. The company could sell 11.000 units of product C with a selling price of 80 per unit....
In a market, there are two firms, firm A and firm B, producing differentiated products. Denoting...
In a market, there are two firms, firm A and firm B, producing differentiated products. Denoting the prices with pA and pB, firm A faces a demand given by qA(pA,pB) = 380−2pA +4 α pB, where 0 ≤ α < 1, and firm B faces a demand given by qB(pA,pB) = 180 − 2pB + pA. Each firm has a constant marginal cost, cA =cB =10and no fixed costs. (a)   Suppose that the firms compete in prices simultaneously. Find the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT