Implement your algorithm in python

Assignment Help Data Structure & Algorithms
Reference no: EM13317439

• Aussie Best Car (ABC) has now decided to award an additional bonus based on the bonus contributed by the sales of an individual car type. It decides to award an additional bonus of x% of the bonus contributed by the sales of Toyota Kluger, y% of the bonus contributed by the sales of Nissan Patrol and z% of the bonus contributed by the sales of Ford Territory. The additional bonus rates (i.e. the values of x, y and z) will be determined by the board of directors of ABC.

The Managing Director therefore requests you to extend your program for A2 in order to facilitate the calculation of the additional bonus as follows.

The main program should ask a user (the Managing Director or another employee) to input the additional bonus rates (i.e. the values of x, y and z) one by one, for the calculation of the additional bonus. The program then should pass the additional bonus rate for a car type to a function called CalculateAdditionalBonus() which will take two inputs: the car type and bonus contributed by the sales of the car type. From the car type information the CalculateAdditionalBonus() function will collect the appropriate additional bonus rate. The function will return the additional bonus for a car type.

The function CalculateTotalBonus() will call sub-functions to calculate the total bonus as calculated in A2. Moreover, CalculateTotalBonus() will call CalculateAdditionalBonus() in a loop to calculate the additional bonus for each and every car type. The function will return the grand total bonus (i.e. the total bonus plus the total additional bonus).

The Managing Director also informs you that they have different profit rates for the three different car types. For example, they have i% profit on Toyota Kluger, j% profit on Nissan Patrol, and k% profit on Ford Territory. The profit rates (i.e. the values of i, j and k) will be determined by the board of directors of ABC.

Once the grand total bonus is calculated your program should ask the user to enter the profit rates (i.e. the values of i, j and k) one by one, for the calculation of the total profit. Your program should also calculate the net profit where net profit is equal to the total profit minus the grand total bonus.

The program should display the total sales, sales for each car type, total bonus, bonus contributed by each car type, additional bonus for each car type and grand total bonus.

It should also display the total profit and net profit.

An example of a partial output can be follows.

Total Sales: $500,000
Sales of Toyota Kluger: $500,000
Sales of Nissan Patrol: $0
Sales of Ford Territorry: $0

Total Bonus: $500
Bonus contributed by Toyota Kluger: $500
Bonus contributed by Nissan Patrol: $0
Bonus contributed by Ford Territory: $0

Additional Bonus for Toyota Kluger: $50
Additional Bonus for Nissan Patrol: $0
Additional Bonus for Ford Territory: $0

Grand Total Bonus: $550

Total Profit: $50000
Net Profit: $49450


The program should finally prompt the user with the following message, "Do you want to calculate the sales and bonus for another year (Y/N)?". If the user enters "Y" then the whole process will be repeated for another year, except that the bonus rates (as shown in the table in A2) will remain unchanged. The program quits if the user enters "N".

Use multiple functions, instead of using a single function to do everything. Create a good design of the functions to make the best use of the code and avoid duplicate calculations. You also need to design your program so that it has components that can be reused in another program, if needed.

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified. Some examples of pseudocode can be found at https://www.unf.edu/~broggio/cop2221/2221pseu.htm.

Implement your algorithm in Python.

Avoid duplicate code. For example, do not calculate the bonus in multiple places in your code.

Comment your code as necessary to explain it clearly.

Select 3 sets of test data that will demonstrate the correct "normal" operation of your program.

Run your program using the test data you have selected and save the output it produces in a text file.

Submit:

1. Your algorithm.
2. The table recording your chosen test data.
3. Source code for your Python implementation.
4. Output listings demonstrating the results of using the test data.


Attachment:- second-assignment.py

Reference no: EM13317439

Questions Cloud

Discuss the law and ethics as it relates to paramedics : Discuss the law and ethics as it relates to paramedics or biomedical science. Write a paper with total 2000 words count,
Draw an erd for the parrot palace information system : Parrot Palace works with TV and movie producers who need birds that can perform special tricks, such as playing dead, reciting poetry, ladder climbs, and various other tricks.
How did the united states become the world s largest debtor : Use the national income identity GDP= C + I + G + X to explain what a current account deficit(negative net exports) means in terms of domestic spending, production, and borrowing
What will happen to the equilibrium price and quantity : What will this do to the demand curve? Of the available list of things in the text that causes a change in demand, which best fits here as the cause of the demand shift?
Implement your algorithm in python : The program should display the total sales, sales for each car type, total bonus, bonus contributed by each car type, additional bonus for each car type and grand total bonus.
Disinflation refers to a situation where : Which definition(s) of the money supply include(s) only items which are directly and immediately usable as a medium of exchange?
Use of mobile devices and the growth of the internet : Students are required to write an academic report as per the format outlined in chapter 5 of the textbook. The report must follow Harvard citation and referencing guidelines.
When adding labor or other factors of production : What are two ways for a competitive firm to determine the optimal level of production, that is, the level of production that will maximize profit or minimize losses?
The market is said to be in equilibrium when : By specializing in the production of one good, a company is able to benefit from economies of scale which increases its revenue. Which of the following is an attribute of specialization?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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