Write a main function that must call your other functions so that your program runs all required components of this Automatic Invoice Generator. Do not forget to add the main guard to ensure that the main() function does not get executed if your program is imported by some other program. A complete sample run of this program is available in section 3.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question
Write a main function that must call your other functions so that your program runs all required
components of this Automatic Invoice Generator. Do not forget to add the main guard to ensure
that the main() function does not get executed if your program is imported by some other
program. A complete sample run of this program is available in section 3.
 
I need help in part 8.
 
7. Write a function named display_final_invoice() that applies a randomly generated
discount to a lucky customer (decided by the get_lucky() function in 6.) and prints the
updated final invoice as follows.
Congratulations!
Good news, you have been qualified for a 10% discount!
Here is your final receipt!
==============================:
============
Spiked Umbrella x 3
Voice Changer x 3
Spy Camerа х 2
21.75
16.50
30.00
Subtotal (old):
Subtotal (new):
68.25
61.42
Discount:
6.83
Тах:
7.99
Total:
69.41
========
============
8. Write a main function that must call your other functions so that your program runs all required
components of this Automatic Invoice Generator. Do not forget to add the main guard to ensure
that the main() function does not get executed if your program is imported by some other
program. A complete sample run of this program is available in section 3.
Transcribed Image Text:7. Write a function named display_final_invoice() that applies a randomly generated discount to a lucky customer (decided by the get_lucky() function in 6.) and prints the updated final invoice as follows. Congratulations! Good news, you have been qualified for a 10% discount! Here is your final receipt! ==============================: ============ Spiked Umbrella x 3 Voice Changer x 3 Spy Camerа х 2 21.75 16.50 30.00 Subtotal (old): Subtotal (new): 68.25 61.42 Discount: 6.83 Тах: 7.99 Total: 69.41 ======== ============ 8. Write a main function that must call your other functions so that your program runs all required components of this Automatic Invoice Generator. Do not forget to add the main guard to ensure that the main() function does not get executed if your program is imported by some other program. A complete sample run of this program is available in section 3.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr