| |
me
Posts: 3
Score: 0
Joined: 10/29/2001
From: Australia
Status: offline
|
Fred auto dealership requires a program that will calculate the sales discount to be applied to a vehicle, based on its year of manufacture and type. The discount extracted from a 2 dimensional table as follows: year of manuf. Of the vehicle is divided into 6 categories (1999, 1998, 97, 96, 95, 94) and the type of car is divided into 5 categories (mini, small, med, full-size, and luxury). No discount is given for a vehicle older than 1994. Discount percentage YrManuf. Mini Small Medium Full size Luxury 1999 0.05 0.055 .06 .065 .07 1998 .04 .045 .05 .055 .06 1997 .03 .035 .04 .045 .05 1996 .02 .025 .03 .035 .04 1995 .01 .015 .02 .025 .03 1994 .05 .01 .015 .02 .025 P/s : .04 = 0.04 (typing for convenience, thanks) Your program is to read the vehicle file, which contains the customer number, customer name, make of car, year of manuf, car type code(1,2,3, 4,or 5) and sales price. Use the year of manuf. And car type code as indexes to retrieve the discount percentage from the discount percentage table. Then apply the discount percentage to the sales price to determine the discounted price of the vehicle. REQUIRED: write a solution algorithm.
|
|