LARP Project Library

Problem 1.1

 

Title :

Sales program

Date :

February 20th, 2006

Reference :

Tools for Structured Design – An introduction to programming logic, 5th Edition

M.Bohl & M. Rynn

1989, Prentice-Hall

P. 19 (Sample Application Program)

Solutions :

Marco Lavoie & Philippe Turcotte

 

Problem Description

 

Create an algorithm which calculates an employee's weekly pay. The weekly pay is based on the employee's total sales at regular prices and sales at rebate prices:

 

§         The employee receives $200 per week as basic salary.

§         The employee receives 6% of his total weekly sales at regular prices.

§         The employee receives 3% of his total weekly sales at rebate prices.

 

The algorithm must prompt for the employee's total sales at regular prices and total sales at rebate prices, and display the employee's weekly pay.

 

Problem Solutions

 

The algorithm is sequential. After reading both total sales amounts, it computes the commission on each total, then add both resulting values to $200 (the base salary), displaying the resulting amount as the employee's weekly pay.

 

Flowchart solution with LARP:

BohlRynn_P19_SalesApp_Flow.larp

Pseudo code solution with LARP:

BohlRynn_P19_SalesApp_Pseudo.larp

Java solution:

BohlRynn_P19_SalesApp.java