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

  Design a menu allow administrator to simulate transmission

Prepare a menu which allow administrator to simulate the transmission of information by manually typing in the login or logoff data. Whenever someone log in or out, the display should be updated.

  Abstract syntax for interpretation in haskell or prolog

State an abstract syntax of the while language appropriate for interpretation in either Haskell or Prolog. In Haskell, the definition must be the code of a few data types.

  Write program to create n-dimensional array on th runtime

Write a program to create an n-dimensional array on the runtime with the help of pointers. The user will enter on the run time that how many dimensions are required.

  Program to compute grade point average

Write a program that uses such a file to calculate your grade point average(GPA). A GPA is based on a scale from 5, where A is 4, B is 3, C is 2, D is 1 and F is 0.

  Write program in java to input basic salary of persons

Write the program in java to input basic salary of 15 persons. Each one of them gets 25% of basic as hra (house rent allowance), 15 % of basic as conveyance and 10 % of basic as entertainment allowance.

  Write program that inputs single integer in digital river

A digital river is sequence of number where number following is n+ sum of its digits for example 12345=12345+15=12360. Write a program that inputs single integer n (1

  Write specifications for method of pre- and post-conditions

Write down specifications for method which advances any given date by one day. Write down statement of purpose, pre- and post-conditions, and description of parameters.

  Write program to enter last names of five candidates

Write down the program which permits the user to enter last names of five candidates in local election and number of votes received by each candidate.

  Write web application that will give report of balance

Write the web application that will give a report of the balance held in a visitor's account during past several months.

  Produce a store procedure to accept parameters

Produce a store procedure named spBalanceRange which accepts three optional parameters. Procedure returns the result set consisting of VendorName,

  Calculate display the area of a rectangle (length * width)

Use the input.txt file. Have it read in the number of records to work on. Then for each record read in a character. If it is a C then read in a value and calculate and display the area of a circle (pi*r 2 ), a R then read in two values and calculate ..

  Develop two single dimension arrays-floating-point numbers

Develop two single dimension arrays which contain 10 floating-point numbers in each array. Develop third single dimension array to hold sum.

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