Published using Google Docs
Data Struct 3 - Guitar Store Revisited
Updated automatically every 5 minutes

Data Structures Assignment 3

Guitar Store Revisited

Create a new main class called Assign3Store.

Purchasing the Products - 70%

Here is a sample run for the first 70%

0. Guitars   $750

1. Pianos   $1400

2. Keyboards   $600

3. Trumpets   $550

4. Saxophones   $700

5. Drums   $1200

6. Banjos   $500

7. Maracas   $70

8. Flutes   $325

9. Xylophones   $175

Please enter the ID number of the product you would like to purchase

6

You chose product 6.  How many Banjos would you like to buy?

3

3 Banjos comes to $1500.0

Would you like to keep shopping?

yes

a) Setting up the arrays - Create 3 parallel arrays for 10 products

b) Using a single for loop, print all the products and their prices with a number beside each:

        0. Fender Stratocaster        $499.95

        1. Marshall Stack Amp        $600.10

        

c) Ask the user which product they want to buy, and scan for the product NUMBER.

        Please enter the ID number of the product you would like to purchase

d) Ask for how many they want to buy and then update the number bought array for the right product.

        You chose product id number: 1.  How many Marshall Stack Amps would you like to buy?

Update the numberbought array, using the chosen product id number to choose the array slot and put in the number they want to buy.

        numBought[ what_they_chose ] = how_many_they_want

e ) Print out the total for that single purchase

        Marshall Stack Amps        5 x 600.10 totals    $3000.50

f) Ask if they want to keep shopping and then loop until they say no.  Print the product list at the beginning of each loop.

Printing out the Bill - Next 20%

g) Once they say no, print out the whole bill but only for those products that they have purchased (number bought is greater than zero)

        Product                        Price                Num Bought        Total

Marshall Stack Amp         600.10                 x 5                3000.50

Strings                        15.50                x 1                15.50

Total                                                        $3016.00

Secret Members’s Discount - Final 10%

If the user enters a product number of -1, they get a special 10% discount.  That means that ALL future prices, total, etc. are 10% less.  You can assume they will enter -1 as their FIRST product choice.

The discount must appear on the bill for EACH item.  How this looks is up to you.

Idea: You may want to add a discount variable that is used throughout but is set to 1.00 for most people but set to 0.90 for the discount.