Maximum Number of Books
There are multiple (T) bookstores in the area.Each shopkeeper has a list of B integers that represents the cost of each book.You have different pocket money(P) for each bookstore.Write a program to calculate the maximum number of books you can buy in each store with the corresponding pocket money.
Explanation
Given P = 600 and B = [120, 140, 110, 180, 120, 110] with a pocket money of 600, we can buy the books at index 0,1,2,4,5 , whose sum is 120+140+110+120+110 is equal to P.
Given P = 300 and B = [120 110 1300 130] with a pocket money of 300, we can buy the books at index 0,1 whose sum is 120 + 110 and is less than P.
Given P = 100 and B = [220 1000 500 2000] with pocket money of 100, we can't buy any book. So the output should be Retry.
Sample Input1
3
6 100
20 40 10 80 20 10
4 70
20 10 300 30
4 200
220 1000 500 2000
Sample Output1
5
3
Sample Input2
2
8 250
2070 1350 365 2750 30 20 140 240
4 500
1070 2893 2200 39
Sample Output2
3
1
Write a C program to accept dimensions of a cylinder and display the surface area and
volume of cylinder.
A basket contains of three fruits has to be created using apples and mangoes
Saurabh believes that the optimal fruit basket of three fruits should
consist of one
Apple and two mangoes. Adish believes that the two apples and one mango. fruit basket should have
There are A apples and B mangoes. Can you calculate what maximum number of imar.chine baskets that can be formed?
Input Format
The first line contains an integer, A, denoting the number of apples.
The next line contains an integer, B, denoting the the number of mangoes.
constrants
1 <=A<= 10^5
1 <= B <= 10^5
Sample
1
2
1
Sample Output
are only 2 fruits in total, hence no optimalees baskets can be
Only one optimal basket can be made be (A, M, M), where A represents an Apple, and M represents a Mango. niteeshkuma
3 optimal fruit baskets can be made i.e (A, M. M) (A, M, M), (A, A, M). where A represents an Apple, and M represents a Mango itees
1. Suppose Mary intends to sell two software products X & Y for the next convention & budgets the following. X Y Total Units Sold. 60 40 100 Revenues, $200 $100 per unit $12,000 $ 4,000 $16,000 Variable Costs, $120 $70 per unit 7,200 2,800 10,000 Unit Contribution Margin, $80 $ 30 per unit $ 4,800 $ 1200 $ 6,000 Fixed Costs 4,500 Operating Income $ 1,500 Required: Required: how-to videotape and a basic equipment set (blocks, stapes, and small pillows). laste year, yegna sold 14,500 videos and 7250 equipment sets. information on the two products is as follows: price of video set and equipment Br. 17.40 and Br. 21.17. variable cost per unit videoset and equpment 5.80 and 8.70. total fixed costs are Br. 101,500. What is the BEP (in units & in Birr. Answer qution 1. What is the sales mix of videos and equipment sets 2. Compute weighted average contribution margin 3. Compute the break-even quantity of each product. 4. What is weighted average contribution margin ratio
Explain with the help of the diagram provided, how the government can internalize the negative externalities in production.
Considered the reaction:
3 NaOH(aq)+ FeCI3(s) →3 NaCI (aq) + Fe(OH)3 (s)
(molar mass: Fe(OH)3=106.84 g/mole; FeCI3=162.19 g/mol
1) if 300 ml of 0.150 M NaOH were added to a solution containing excess FeCI3, CALCULATE the mass of Fe(OH)3 would be produced
The bank is requiring a debt-to-equity rate of 0.75. what is the maximum additional amount will be able to borrow
1.Same program as addition teaching program
2.But the student must get three questions correctly in a row to pass the test.
3.If the student get 1 question wrong, the counter will be reset to zero.
Code:
import random
print("Welcome to New Academy:")
print("It is a mathematic test. You have to answer 5 questions.")
print("You need to answer 3 questions correctly to pass the test.")
print("If you failed, you need to repeat the test.")
# setup the stop conditions for the program
# generate 5 addition questions
# before that, generate 2 numbers randomly
# compute the summation of the 2 numbers and store it in a variable
# Track how many questions were answered correctly by the student
# if the student got 3 questions and above correctly,
# congratulate the student and stop the program
# else, repeat the test.
1.Create a program to test the addition (+) skill of students. (0 – 100)
2.The program can automatically generate 5 questions for a student to answer.
3.A student must correct at least 3 questions to pass the test.
4.If the student failed, he needs to repeat the test.
Code:
import random
print("Welcome to New Academy:")
print("It is a mathematic test. You have to answer 5 questions.")
print("You need to answer 3 questions correctly in a row to pass the test.")