Parameter variable a number of marbles

Assignment Help Business Management
Reference no: EM132158482

Define the function marbles(n) to solve the following problem:

A company packages and sells boxes with marbles. The boxes come in two sizes: huge and small. The "huge" box contains 48 marbles and the "small" box contains 8 marbles. The company makes the most gain by selling huge boxes: CDN$26 each. Small boxes produce less gain but still some: a small box provides the company CDN$4 gain. On the other hand, the company loses CDN$ 2 per marble not packaged. Thus, the company will attempt to package as many huge boxes as possible, and then as many small boxes as possible.

This function receives as input in the parameter variable a number of marbles available and it should return a string with the following information: first, the number of huge boxes to package, followed by two dots ("..") followed by the number of small boxes to package, followed again by two dots, followed by the number of unused marbles, followed by two dots and finally the money the company makes, considering the gains (because of the boxes packaged) minus the losses (because of the unused marbles).

For example, calling this function as marbles(503) should return '10..2..7..254 ', because with 503 marbles the company can package 10 huge boxes, 2 small boxes and there are 7 unused marbles. The company makes CDN$ 254, that is, CDN$26 * 10 = CDN$ 260 because of the 10 huge boxes plus CDN$ 4 *2= CDN$ 8 minus CDN$ 2 * 7 = CDN$6 (the seven unused marbles).

Notice that the company may have a net loss, when there are not enough cookies to create any package.

For example:

cookies(7) should return '0..0..7..-14'

As an example, the following code fragment:

print (marbles(503))

should produce the output:

10..2..7..254

Reference no: EM132158482

Questions Cloud

Firewall port ranges and individual port : Discuss types of conflicts that may arise between firewall port ranges and individual port allow/block settings.
What is the range for variable r : QST MF 793 Statistics for Mathematical Finance - Boston University - What is the range for variable R (mininum, maximum), the number of Republicans senators
What was your main term course : What was your Main term course? Reflect on the connection between knowledge or concepts from this course and how those have been or could be applied.
E-reader formation summarizes recommendation : A classmate of mine is not sure whether to buy a PC or a tablet. He needs the device for schoolwork (mostly Microsoft Office), for Web access
Parameter variable a number of marbles : This function receives as input in the parameter variable a number of marbles available and it should return a string with the following information:
Conduct a comprehensive literature search : Read the assigned resources pertaining to this week's topics. Conduct a comprehensive literature search and review three additional peer-reviewed scholarly.
Find the network id of the lan that this ip add belongs to : Assume MTU=1500 Byte. Given an IP Packet = 1996 Bytes (header: 20 B + payload: 1976 B), show how you will break the packet into fragments
What is the ethical danger of using agents in negotiation : What is the ethical danger of using agents in negotiation? How does Carr argue that strategy in business is analogous to strategy in a game of poker?
Describe your expectations for finding law : On the discussion forum, describe your expectations for finding law from anywhere in the world by use of the internet. Why is it important to have a uniform.

Reviews

Write a Review

Business Management Questions & Answers

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd