Question

..Construct a solution algorithm for the following problem. Your solution should contain \: .Defi...

..Construct a solution algorithm for the following problem. Your solution should contain \:

.Defining diagram

.Pesudo code algorithm

.Desk checking of the algorithm (three test case for each question including one "Invalid" Desk Checking)

A transaction record on a sales commission file contains the retail price of an item sold, a transaction code which indicates the sales commission category to which an item can belong and the employee number of the person who sold the item. The transaction code can contain the values A, B or C which indicate that the percentage commission will be 6%,8% or 10%respectively..Construct an algorithm that will read a record on the file, calculate the commission owing for that record and print the retail price, commission and employee number

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Algorithm:

To read the transaction file, calculate commission and print the information.

Input: Transaction file

Output: Retail Price, Commission, Employee number

Start.

1. Read the data file.

2. Create a dictionary with A, B and C as keys and 0.06, 0.08 and 0.10 as respective values.

3. Loop over the data rows.

4. For each row calculate commission by multiplying retail price with value at transaction code key of dictionary.

5. Print the retail price, commission and employee number

6. End Loop

STOP

Pseudo Code:

This program will allow user to read a sales transaction file and

calculate the commission and print the required information.

Read the data file and store the data in f.

define a dictionary code = {A:0.06, B:0.08, C:0.1}

FOR each row in f:

       com = retailprice * code[transactioncode]

       print ("Retail Price = " retailprice)

       print ("Commission = " com )

       print ("Employee Number = " eno)

ENDFOR

Add a comment
Know the answer?
Add Answer to:
..Construct a solution algorithm for the following problem. Your solution should contain \: .Defi...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • :) Problem: ??? Your task: implement in CH the algorithm solution shown below. Then analyze it...

    :) Problem: ??? Your task: implement in CH the algorithm solution shown below. Then analyze it and explain, using just one or two sentences, what it does. Write this explanation as a comment at the top of your program. This explanation will be worth 5 points of your total grade. Do not be too detailed (for example, do not write it opens a file and then declares variables, and then reads from a file...), it should look like the problem...

  • This program is intended for C++ A special type of situation, called a controlled break, can...

    This program is intended for C++ A special type of situation, called a controlled break, can occur when processing records of data must temporarily pause because a key value has changed. For example, a control break might occur in a report that contains subtotals for groupings of records. This program requires such a procedure.   Sales people at a local car dealership are paid by commission. For every car sale, a sales person earns 30% of the base price or $100,...

  • Assume that an imaginary supermarket sells items that are identified by a unique item number which...

    Assume that an imaginary supermarket sells items that are identified by a unique item number which is an integer in range 100 to 499 inclusive. The items are classified in four different categories based on their numbers, and each category defines a different sales tax rate. These four categories along with the range of item numbers included in them, and their specific sales tax rates has been summarized in the following table:    Category Item Numbers Sales Tax Rate A                100...

  • Salary Lab In this lab you are going to write a time card processor program. Your...

    Salary Lab In this lab you are going to write a time card processor program. Your program will read in a file called salary.txt. This file will include a department name at the top and then a list of names (string) with a set of hours following them. The file I test with could have a different number of employees and a different number of hours. There can be more than 1 department, and at the end of the file...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • need help for solve multiple choice question... 1.The employee summary report option shows Select one: a....

    need help for solve multiple choice question... 1.The employee summary report option shows Select one: a. earnings and deductions from a paycheque b. all information entered in employee records c. wage or salary amounts d. all year-to-date totals 2.In the process of correcting a wrong employee error all but one is used – Select one: a. prepare a new entry for the correct employee b. one should remember to recalculate the taxes c. open the adjust cheque window for the...

  • Please help with this problem. Solution: Show your your analysis in organized schedules as much as...

    Please help with this problem. Solution: Show your your analysis in organized schedules as much as possible. A schedule for completing Requirement #1 is provided for you. Be sure to properly link cells and use formulas where applicable. Requirement 1: Scenario 1 Scenario 2 Scenario 3 Current Year $35.00 43,000 4 Problem B (26 points): 5 Block Ltd makes BLOCKS. Their pre-tax income and their margin of safety have both been low 6 compared to the levels the company would...

  • If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top o...

    If possible please just send the SQL statement. Thank you Each question within deliverable 3 must begin on a new page and be sure to document the question as the title of each item at the top of each page. Also, using a 12-point font, include the SQL statement and then provide a screen shot of each query. The screen shots must include both the SQL statement and the results for each item below based on the data entered in...

  • Write a program in C++ that simulates a soft drink machine. The program will need several...

    Write a program in C++ that simulates a soft drink machine. The program will need several classes: DrinkItem, DrinkMachine and Receipt. For each of the classes you must create the constructors and member functions required below. You can, optionally, add additional private member functions that can be used for doing implementation work within the class. DrinkItem class The DrinkItem class will contains the following private data members: name: Drink name (type of drink – read in from a file). Type...

  • QUESTION 2 The following is a list of 10 control plans and ten system failures that...

    QUESTION 2 The following is a list of 10 control plans and ten system failures that have control implications. Match the letter from the list of the best control plan to prevent the system failure from occurring. A letter should be used only once I can approve all customer orders. a. b. Any correcting entries to be made by the customer service representative are done at a later time Procedures for rejected inputs rather than as the data is input...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT