You friend, Cathy has a small business and knowing that you have taken a programming class wants you to create an application for her. Her company is called Cathy's Candles. Cathy's Candles offers candles in three styles - tea lights, votives and pillars. The colors available are Federal Blue, Sunflower Yellow, Christmas Red and Milky White. The scented candles have an additional charge.

We will make some assumptions - the credit card information of the customer is already in file, so only the name of the customer and their customer id will be obtained for this application. Only known customers are placing orders. At this point, Cathy's Candles cannot handle new customers since it is a small scale operation.Each order is processed only for one style, color, scented / unscented candles at this time. If the customer wants to place another order, a new run is needed.

Style / Base Price / Scented Price(Additional)
Tea Lights / 5.75 / 1.00
Votives / 8.75 / 2.00
Pillar / 12.75 / 5.00

[zoom document as needed to view the Screen shots.]

Program Requirements:

  1. Write an algorithm for the problem.
  1. Create a void function name info( ) that will show the following information.

  1. Create a void function called getCustomer with two parameters name and id. The customer should be prompted to enter their full name and id. Use strings for both the name and id. You must use reference parameters in this case for name and id.
  1. Prompt the user for the style of the candle. T or t for Tea lights, V or v for votives and P or p for Pillars are the acceptable choices. If the user enters any other character, they should be prompted until they enter the correct choice.

Note: Since V is a valid character here, the user will proceed to next step.

  1. Prompt the user to enter Y or y for Yes, N or n for No. The question asked is "Do you want scented candles?" If the user enters any other character, they should be prompted until they enter the correct choice.Note: n is an acceptable character.
  1. Next prompt the user for their color choice. The acceptable choices are F or f for Federal Blue, S or s for Sunflower Yellow, C or c for Christmas Red and M or m for Milky White.If the user enters any other character, they should be prompted until they enter the correct choice. Note: c is an acceptable character.
  1. Make sure appropriate colors are printed in the summary. If the user enters Tea lights and no for scented candles, then price is calculated accordingly. Similarly if user enters Tea Lights and yes for scented candles, the price calculation is different because scented candles have an additional charge. Do this for all the different styles.if the user enter Y, then the summary should mention scented. If the user enter N, then the summary should mention unscented.
  1. Prompt the user for the quantity of candles needed. Validation should be done so that quantity is not a negative number or 0.
  1. Calculation:
  1. Subtotal should be calculated first using a value returning function calcSubtotal. The price and quantity are the formal parameters.
  2. Shipping fee is calculated using a value returning function called calcShipping. The formal parameter is subtotal. The shipping fee is 3% of the subtotal.
  3. The tax is calculated using a value returning function called calcTax. The formal parameter is subtotal. The tax is 8% of the subtotal.
  4. The total due is a value returning function called calcTotal. The formal parameters are subtotal, shipping fee and tax.
  1. Summary:

The summary should print scented or unscented candles, the style of candle, the color, the subtotal first, followed by the shipping fee, and sales tax and finally the total due.

Print a message to show that the customers will be charged the amount using the credit card in file.Note: we are dealing with dollars and cents.

  1. Sample runs are shown in next page.

Run1:

Run2:

Note: If you do not create the functions mentioned here but instead choose to use only the main function to solve this program, 5 points will be automatically deducted for this program.

Testing runs to be pasted in Word document for the following choices:

  1. style - V , scented - Y and quantity - 9
  2. style - V , scented - N and quantity 4
  3. style - T ,scented - y and quantity 3
  4. style - t , scented - n and quantity 5
  5. style - P , scented - y and quantity 6
  6. style - p , scented -N and quantity 10

Choose different colors when you run.

Rubric for Hands-on

Criteria / Points Possible / Your points
Algorithm / 5
Comment header and Internal Comments / 2
Main / 10
Info function / 2
getCustomer function / 2
calcSubTotal function / 2
calcShipping function / 2
calcTax function / 2
calcTotal function / 2
Runs ( 6 tests as specified) / 6
Total / 35

Final Checklist before upload of zipped files

  1. Algorithm
  2. Source code - comment header, internal comments, and code to execute the program.
  3. 6 runs as listed in the document