Write an algorithm in structured english

Assignment Help Programming Languages
Reference no: EM13186527

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 ofx% of the bonus contributed by the sales of Toyota Kluger,y% of the bonus contributed by the sales of Nissan Patrol andz% of the bonus contributed by the sales of Ford Territory.The additional bonus rates (i.e. the values ofx,yandz) will be determined by the board of directors of ABS.

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 ofx,yandz) 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 calledCalculateAdditionalBonus()which will take two inputs: thecar typeandbonuscontributed by the sales of the car type. From the car type information theCalculateAdditionalBonus()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 callCalculateAdditionalBonus()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 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.

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

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. 

Implement your algorithm in Python.

Avoid duplicate code. For example,do notcalculate 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.

It is important that the output listings are not edited in any way.

Rationale

Reinforce topic material related to iteration.

Reinforce topic material related to decision structures, Boolean logic and value returning functions.

Reference no: EM13186527

Questions Cloud

Create a database for the sales and bonus records : Create a database for the sales and bonus records of different years and reinforce topic material related to files and exceptions.
Compute the ph of hydrochloric acid : Concentrated acids and bases may fall outside this range. Calculate the pH of hydrochloric acid, if the solution is sold as 37 % by weight (37 g HCl / 100 g solution) with a density of 1.18 g/mL.
Discuss the characteristics of international strategies : Discuss the characteristics of international, multidomestic, global, and transnational strategies. Include situations and a specific example in which each strategy would be most appropriate.
State what is the delta u for the process : How much energy is dissipated as heat, which is exchanged btwn the system and the heat-sink?C. What is the delta U for the above process?
Write an algorithm in structured english : Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified and implement your algorithm in Python.
How sea turtle populations have started to increase : In Costa Rica, only a few beaches remain that are nesting grounds for sea turtles. Some of those beaches have communities situated near them; traditionally, the local people collected the turtle eggs and sold them for their purported aphrodisiac p..
State what is the amount of heat involved in calories : Calories given off when 83g of water cools from 48 degrees Celsius to 27 degrees Celsius.
Reinforce topic material on simple functions : Select 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program.
Explain what is the molar mass of the compound : You dissolve the sample in .550 mL of water and determine that the osmotic pressure of the resulting solution is .107 torr at 35 deg C (760 torr = 1.00 atm). What is the molar mass of the compound?

Reviews

Write a Review

Programming Languages Questions & Answers

  Statement to assig nnew value to first element of array

Suppose that array of integers named a has been declared and initialized. Write single statement which assigns a new value to first element of the array.

  Write program to open file for reading

Write the program to open file for reading which has twenty (20) rows and in each row there are three (3) columns. After reading each row call user-defined function to display each row.

  Write an algorithm that converts a linear measurement

Write an algorithm that converts a linear measurement in feet and inches into meters. One inch is equivalent to 2.54 centimeters.

  Implicit unsafe type conversions-statements and expressions

Write a report using APA format for references that researches the definition of the language with respect to implicit unsafe type conversions in both assignment statements and expressions.

  Write a script to declares and sets variable

Write a script that declares and sets a variable thats equal to the total outstanding balance due. If that balance due is greater than $10,000.00.

  Program to inputs encrypted four-digit integer

Write separate program to inputs encrypted four-digit integer and decrypts it to form the original number. thanks in advance for ur help.

  Write the a switch statement whose controlling expression

Write the a switch statement whose controlloing expression is the variable area_code.

  Create program which calculate distance travelled by boat

Create a program which calculate distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river.

  Decrypt all entries of username variable

Need a another cgi file to decrypt all entries of ' username ' variable and restore it to original plain/text, it should be start restoring the inputs to original text the cgi file

  Draw application which reads inventory records file

Draw an application which reads inventory records file and produces a report whihc show item-number, item-description, and price of every item on each day, one through 7.

  Create script which checks day of the week

Create a script which checks day of the week, and takes one of two actions (step 2 or 3) depending on the day. If day is Monday through Friday, print (send to stdout) name of the day.

  Appropriate for two classes to inherit from superclass

CDs and DVDs have several common characteristics. Would it be appropriate for these two classes to inherit from a common superclass?

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