Question: const float DONATION = 0.17; const float USED_DISCOUNT = 0.10; const float PREMIUM_DISCOUNT = 0.06; const float ULTRA_DISCOUNT = 0.12; const int WEBADD = 49;

const float DONATION = 0.17; const float USED_DISCOUNT = 0.10; const float PREMIUM_DISCOUNT = 0.06; const float ULTRA_DISCOUNT = 0.12; const int WEBADD = 49; 

const int WEBADDULTRA = 125;

Prompt the user to input the following user information, and echo the information to the screen. 1.Full User Name - a string that may contain blanks ex: Jean Morton

2.User Alias a string that does not contain blanks ex: potteryQueenJean

3. User ID an integer in the range 1 thru 99999 ex: 72014 Prompt the user for the name of the file containing the list of items for auction:

Open the file and process the following for each item in the file: Read the line containing the user code. The content in the code can be deciphered as follows.

1. User FileID integer ex: 72014

2.User Status and Payment Code a string, whose first character represents the customer type. ex: P= premium, S= standard, U= ultra. (we will ignore the rest of this string for now)

3. Balance Due a floating point value. ex: 38.99 if negative, its a credit Compare the five character UserID supplied by the user, to the FileID read from the input file.

If they do not match, display an error message and exit the program. If they do match, continue on with the program. Examine the structure of the data by opening, and examining the content of the sample input files provided. Three new characteristics are added to our description of the auction items. Item quality, addons, and state.

Read the list of items.

1. Item_Quality integer value in range (1-100) ex: 90

2.Item_Addon a character value ex: F F , E , or D only.

3.Item_State a string value ex: New or Used 4.Name a string that may contain blanks ex: Chinese Vase with Green Elephant decor

5.Time a string that does not contain blanks ex: 07:10:36

6. Price a floating point value. ex: 38.99 These three new items are describe in further detail below. 7.Item_Quality is a whole number value representing the overall condition of the item, in the range of 1 to 100.

8. Item_Addon is a character representing additional discounts, conditions, or actions to be taken on this item. o F is a full discount on the item. o E means that the item is exempt from all discounts o D means that the item gets a descriptive discount ( it depends on the type of customer).

Item_State is a string indicating either a new New or used Used item up for auction.

Consider the following as each item is processed, before the sum or average or donation amount is calculated.

Dont worry about adjusting the highest and lowest values determined, with respect to the discounts. Discounted values are not considered. No discounts or adjustments apply to a file containing one item.

1. If the item is New, and the customer is a Premium customer, and the item is not Exempt from all discounts - then the item price is reduced by PREMIUM_DISCOUNT immediately.

2. If the item condition is used, and the quality is below 50, and the item is not exempt from all discounts, or if the item condition is new, and the quality is less than or equal to 40, and the item item has a Full addOn discount status then the item price is reduced by USED_DISCOUNT.

3. If the item is new and priced above $1000, and the AddOn code is D, the and the customer is either Ultra or Premium, then the ULTRA_DISCOUNT is doubled in value and then is applied to the item, and webAddPoints is increased by the constant value of WEBADDULTRA. See the program output, and include the same information as shown for Item Statistics. If the customer has a balance due, subtract it from the total sum. If the customer has a credit, add it to the total sum. Display this as the Adjusted Sum.

4. If the customer has a credit - increase their webAddPoints by adding to it, the constant value of WEBADD. Determine and display the following information:

1. Total Number of all items up for auction an integer value

2. Highest and Lowest Cost found amongst these items floating point values.

3.Average Cost of all items floating point value. (price sum / number items )

4. Rounded Average Cost of all items an integer value. (round average found above ) 5.WebAddPoints floating point value

file:1

65656 P12zyxw003432v35 -91.00 100 E Used 1.99 17:49:51 Light up skull 10 D New 1.99 17:49:51 Light up skull 100 D Used 915.99 23:50:23 Fords Coffee mug 99 E New 913.49 08:51:58 Reagans coffee mug 2 D Used 1.00 09:16:12 Box of old junk 99 F New 1.39 11:47:16 box of pens 
file:2 
3 
65656 P12zyxw003432v35 1.00 89 D New 38.99 11:21:47 Green Chinese Vase 90 F New 74.00 07:10:36 Hummel Figurine 56 E Used 499.50 07:59:51 Norma Electric Guitar 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!