Create a program that will retrieve and display sales information. Use a structure to store the data. The structure will need to include the following items. Use appropriate naming for the variables...


  Create a program that will retrieve and display sales information. Use a structure to store the data. The structure will need to include the following items. Use appropriate naming for the variables and structure.



  1. Item Number  - int

  2. Item Name  - string

  3. Item Quantity - int

  4. Total Cost   - double

  5. Credit Card Number - long long

  6. Credit Card User Name  - string

  7. Credit Card Expiration Month Year - int

  8. Credit Card Security Code - int

  9. isValid  - bool  - code this to default to false.


Create a single structure from the items listed above.



  1. Create a method that will display all  the elements of a passed structure -defined as above.  Name this method as you wish using proper naming conventions.

  2. Create a method namedpreCheck with a structure above as a parameter passed by reference.


    1. Using the Table below, match the structure's item number and load the item name (b) and calculate the total cost (d) at the Table's Item Cost * Item Quantity.

    2. If the item number is  found, set the isValid indicator to true.



  3. The following tasks are done in main()

    1. Issue the command below. It will display bool variable results asfalse ortrue instead of 0 or 1.

      1. cout <>



    2. Create a variable that uses the structure above.

    3. Prompt for the Item Number and Quantity ( 1 & 3 ) for this structure variable.

    4. pass the structure variable to thepreCheck method.

    5. If the isValid variable is true, then Prompt for items 5-8 (The Credit Card information)

    6. Pass the structure variable to the method created in Step 1 to display the contents of the structure variable.





Deliverable is working CPP file.

5 Points Extra Credit:
Create a structure for the Credit Cards items (e - h) and "nest" this structure inside the sales structure above.
The remaining code must function as expected with this change.








































Item NumberItem NameItem Cost
1001Foam Padding$8.50
1002Box Tape$10.11
1003Moving Blanket$20.00
1004Moving Box$4.25

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here