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. Item Number  - int Item Name  - string Item Quantity - int Total Cost   - double Credit Card Number - long long Credit Card User Name  - string Credit Card Expiration Month Year - int Credit Card Security Code - int isValid  - bool  - code this to default to false. Create a single structure from the items listed above. 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. Create a method named preCheck with a structure above as a parameter passed by reference. 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. If the item number is  found, set the isValid indicator to true. The following tasks are done in main()  Issue the command below. It will display bool variable results as false or true instead of 0 or 1. cout << boolalpha; Create a variable that uses the structure above. Prompt for the Item Number and Quantity ( 1 & 3 ) for this structure variable. pass the structure variable to the preCheck method. If the isValid variable is true, then Prompt for items 5-8 (The Credit Card information) 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 Number Item Name Item Cost 1001 Foam Padding $8.50 1002 Box Tape $10.11 1003 Moving Blanket $20.00 1004 Moving Box $4.25

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

  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 named preCheck 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 as false or true instead of 0 or 1.
      1. cout << boolalpha;
    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 the preCheck 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 Number Item Name Item Cost
1001 Foam Padding $8.50
1002 Box Tape $10.11
1003 Moving Blanket $20.00
1004 Moving Box $4.25
 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education