C++: Derived Data Types - Sales (Challenge)

seit's Avatar, Join Date: Mar 2011
Newbie Member
Design and code a program that totals a set of sales records, each of which consists of a quantity, a unit price and a taxable status. Your program prompts for and accepts a quantity, a unit price and a taxable status and continues to accept such triples until the user enters 0 for quantity. Your program can store up to 100 triples. It displays the pre-tax total, the gst, the pst and the sales total for all of the information entered.
The output from your program looks something like

Sale Totaller
=============
Quantity : 2
Unit Price: 1.99
Taxable: y
Quantity : 1
Unit Price: 2.99
Taxable: n
Quantity : 5
Unit Price: 1.00
Taxable: n
Quantity: 0

Subtotal 11.97
GST (7%) 0.28
PST (8%) 0.32
Total 12.57

Your program includes a function named total that receives the sale information in an array of instances of Sales types and returns the total information in an instance of a Total type. A Sales type holds the quantity, the unit price and the taxable status for a single item. A Total type holds the total price, the total gst and the total pst. Place your function prototype and your declarations of the two derived types in a file named Sales.h

Please help me.
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
What's the prize, as this is marked Challenge?
Or is this your homework, in which case where are you stuck?