Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9476582

Have any Question?


Related Questions in Programming Language

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As