Question

In: Computer Science

An experienced Python programmer in your company wants your assistance calculating the division of the numerator...

An experienced Python programmer in your company wants your assistance calculating the division of the numerator being the sum of all the multipliers of four divided by the denominator of all the multipliers of three using one for loop and one range statement respectively. Both sums of the numerator and denominator respectively are to be calculated using the same range of numbers between (and including) the number 0 and up to (and including) the number 100. The experienced Python programmer gives you a hint that the answer for the requested division is .77243. Please create the script that uses one for loop and will produce the expected output below. Your code must use a loop to receive credit.

Expect Output:

The sum of all multipliers of 4 is: 1300

The sum of all multipliers of 3 is: 1683

1300 divided by 1683 is 0.7724301841948901

Solutions

Expert Solution

  • Below is the detailed implementation of the above problem in PYTHON with code and output shown.
  • For better understanding please read the comments mentioned in the code.
  • In the code below only a for loop is used with a range statement and the sum of multipliers of 4 and 3 are calculated and the output is printed.
  • CODE:

#variable to store sum of multipliers of 4
four=0
#variable to store sum of multipliers of 3
three=0
#for each number from 0 to 100
for i in range(0,100+1):
#if i is divisible by 4
if i%4==0:
four+=i
#if i is divisible by 3
if i%3==0:
three+=i
#printing the output
print("The sum of all multipliers of 4 is: {}".format(four))
print("The sum of all multipliers of 3 is: {}".format(three))
print("{} divided by {} is {}".format(four, three, four/three))

  • OUTPUT:
The sum of all multipliers of 4 is: 1300
The sum of all multipliers of 3 is: 1683
1300 divided by 1683 is 0.7724301841948901
  • Below are the screenshot attached for the code and output for better clarity and understanding.

CODE and OUTPUT

So if you still have any doubt regarding this solution please feel free to ask it in the comment section below and if it is helpful then please upvote this solution, THANK YOU.


Related Solutions

5. The Chief of the Medical staff has asked for your assistance in calculating the length...
5. The Chief of the Medical staff has asked for your assistance in calculating the length of stay (LOS) for the following patients in the medical and surgical units with specific diagnosis codes. Please respond to the questions below and show your mathematical on excel sheet for each calculation listed below. PATIENT NAME PATIENT AGE HOSPITAL UNIT    DIAGNOSIS CODE HOSPITAL LOS Pederson 18   MEDICAL E11.9 4 Joynes 46 SURGICAL K51.90 5 Anderson 38 MEDICAL J44.9 8 Connors 17 MEDICAL G45.9...
Hamish Ltd needs your assistance in calculating and disclosing the taxation expense for the financial year...
Hamish Ltd needs your assistance in calculating and disclosing the taxation expense for the financial year ended 30 June 2018. Hamish Ltd has supplied you with an extract from their income statement and from their balance sheet as well as a list of other information that need to be considered. Hamish Ltd Income statement for the year ended 30 June 2018 $ Income 904,000 Revenue from Sales 850,000 Interest Revenue 18,000 Rent Revenue 36,000 Expenses 647,000 Administration and selling expenses...
A client at a software design company wants assistance processing their documents. After interviewing the client...
A client at a software design company wants assistance processing their documents. After interviewing the client you find that their documents consist of a one sentence title, a date, and a series of paragraphs. Each paragraph is a simple list of sentences. Paragraphs are separated by new lines. Each document also has an author (first and last name) and a document access level (open, internal or confidential). At a minimal level the client would like the software to be able...
Your company has a division on the Isle of Wight. The accounting beta of the division...
Your company has a division on the Isle of Wight. The accounting beta of the division is 0.90. Your company’s accounting beta is 1.2. Your company’s equity beta is 1.4. The firm has a value of 800M, debt of 200M, and cash and marketable securities of 50M. The risk-free rate is 2.5% and the GRP is 6%. What is the proper cost of capital for the division?
A pizza company has asked you for your assistance in developing a model that predicts the...
A pizza company has asked you for your assistance in developing a model that predicts the demand for the new snack pizza named Pizza1. This product competes in a market with another brand that is named B2 for identification. At present, the products are sold by three major distribution chains identified as​ 1, 2, and 3. These three chains have different market​ sizes, and,​ thus, sales for each distributor are likely to be different. The accompanying data table contains randomly...
MRE Sales is looking to acquire an ERP and has asked for your assistance. The company...
MRE Sales is looking to acquire an ERP and has asked for your assistance. The company can purchase the system outright for $120,000 plus 5% sales tax, and delivery and install charges of $2,000. The ERP is expected to last 5 years and have a salvage value of $8,000. The company will use straight-line depreciation over the 5-year life. Its income tax rate is 40%. The company’s cost of capital is 12%. The system is expected to bring annual benefits...
? Your company has two? divisions: One division sells software and the other division sells computers...
? Your company has two? divisions: One division sells software and the other division sells computers through a direct sales? channel, primarily taking orders over the internet. You have decided that Dell Computer is very similar to your computer? division, in terms of both risk and financing. You go online and find the following? information: Dell's beta is 1.18?, the? risk-free rate is 4.2 %?, its market value of equity is $ 67.3 ?billion, and it has $ 708 million...
Your company has two​ divisions: One division sells software and the other division sells computers through...
Your company has two​ divisions: One division sells software and the other division sells computers through a direct sales​ channel, primarily taking orders over the internet. You have decided that Dell Computer is very similar to your computer​ division, in terms of both risk and financing. You go online and find the following​ information: Dell's beta is 1.15​, the​ risk-free rate is 4.1%​, its market value of equity is $65.9 ​billion, and it has $704 million worth of debt with...
Your company has two divisions: One division sells software and the other division sells computers through...
Your company has two divisions: One division sells software and the other division sells computers through a direct sales channel, primarily taking orders over the internet. You have decided that Dell Computer is very similar to your computer division, in terms of both risk and financing. You go online and find the following information: Dell's beta is 1.21, the risk-free rate is 4.5%, its market value of equity is $67 billion, and it has $700 million worth of debt with...
Your company has two? divisions: One division sells software and the other division sells computers through...
Your company has two? divisions: One division sells software and the other division sells computers through a direct sales? channel, primarily taking orders over the internet. You have decided that Dell Computer is very similar to your computer? division, in terms of both risk and financing. You go online and find the following? information: Dell's beta is 1.23?, the? risk-free rate is 4.7%?, its market value of equity is $67.9 ?billion, and it has $704 million worth of debt with...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT