Create a database for the sales and bonus records

Assignment Help Programming Languages
Reference no: EM13186531

TheAussie Best Car (ABC)authority now wants to create a database for the sales and bonus records of different years.

The program that you coded for your Assignment 3 (A3) should calculate Total Sales, Total Bonus etc. for a particular year. TheABCauthority now wants to store the detail sales and bonus information for every year in a text file. So you are now requested to modify your program of Assignment A3 as follows.

The main program should first display a menu as follows. A user needs to select an operation from the main menu.

===========================================

Welcome to ABC Car Shop:

Please choose an option from the followings.

<A>dd sales details in the database.

<S>earch sales details for a given year in the database.

<Q>uit.

===========================================

If a user chooses the option <A> then the program first asks the year (such as 2014) for which the sales and bonus information is being calculated. It then computes the sales amount of each car type, total sales, total bonus and bonus contributed by each car type, as it did before in A3.

The program then collects the additional bonus rates for all car types from a text file called "additionalBonusRates.txt" (stored in the same folder) that contains the bonus rates as follows.

Toyota Kluger Nissan Patrol Ford Territory

========== ========== ===========

10% 5% 3%

Once the additional bonus rates are collected the program should pass them to a function calledCalculateAdditionalBonus()that will then be used by another function calledCalculateTotalBonus()like in A3. The program will 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 as it did for A3. However, it will now also display the year for which the sales and bonus information is being calculated. The year will be displayed at the beginning followed by the other information as follows.

YEAR: 2014

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

 

After storing the sales and bonus information in the sales.txt file, the program prompts 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. Otherwise the program displays the main menu for choosing an operation.

Now if the user chooses the option <S> then the program first asks the use to enter the year (such as 2014) for which the sales and bonus information is being searched. To facilitate the Search option you must use the List data structure. The program then collects the sales and bonus information from the sales.txt file and displays it as follows.

YEAR: 2014

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

After displaying the sales and bonus information the program prompts the user with the following message,"Do you want to search for another year (Y/N)?". If a user enters"Y"then the program asks the user to enter the year for which the information needs to be searched and displayed. If the user enters"N"then the program displays the main menu.

Finally, the program quits if the user chooses the option <Q>.

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 files and exceptions.

Reinforce topic material related to lists.

Reference no: EM13186531

Questions Cloud

Explain an amount of lactic acid is dissolved in water : An amount of lactic acid is dissolved in water and the reaction is allowed to reach equilibrium. The concentration of the protonated acid is found to be 2.5 M.
What steps can an organization take to reduce these risks : Examine possible risks that can arise when systems are constructed using COTS. What steps can an organization take to reduce these risks?
State the greatest concentration of dissolved ag : Which of the following, when added in equal molar amounts to the AgOH/water mixture, will lead to the greatest concentration of dissolved Ag+ at equilibrium?
What are some reasons that firms decide to export : What are some reasons that firms decide to export their products or services What does a firm need to consider when developing an export and import plan You may apply companies (The way they executing their plan) as example to support your analys..
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.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write program which asks user for number of bolts

Write C++ program which asks user for number of bolts and number of nuts in their purchase and then computes and prints out total cost.

  Values of variables of logical section of the pseudocode

What are the values of variables a, b, and c after each line of code of each logical section of the pseudocode. Show why the logical section is running.

  Explaining box properties available in css

Browse the Web and choose a site that could benefit from box properties available in CSS. Make a screen capture of the page and indicate how you would change border and spacing properties.

  Write a program to read student data from standard input

Write a program to read student data from standard input, sort it by last name / first name, and print result to standard output.

  Invoke method to tell air conditioner object to turn on

Assume there is a reference variable myAC to an object of this class, which has already been created. Using the reference variable, invoke a method to tell the air conditioner object to turn on.

  Program to retrieve records based on last name-first name

Customer service representatives wish to be able to retrieve records based on Last Name + First Name, Product Number, or State fields. Write down steps involved in your analysis of this problem?

  Determine recursive procedure and iterative procedure

Determine the example or recursive procedure and represent it as iterative procedure. Also, select the iterative procedure which you would re-write as recursive.

  Develop two packages to accept information

Develop two packages, package1 comprises two classes manager and clerk.both classes having method to accept corresponding information.packages.

  Write the constructor function makestk

Write the constructor function makestk, predicate function emptystk and mutator functions pushstk and popstk

  Write assignment statement with one arithmetic operator

Write a simple assignment statement with one arithmetic operator in some language you know. For each component of the statement.

  Use one-dimensional array to read in twenty numbers

Use the one-dimensional array to solve problem: Read in 20 numbers, each of which is between 10 and 100. As each number is read, print it only if it is not duplicate of number which has already been read.

  Create command line based application for perfect hundred

Create a COMMAND LINE based application to play a game called Perfect Hundred. In this game, the user/player competes against the computer.

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