Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**** has to be done using C++ please **** **** C++ **** Exercise 5 Cash Register: Ask the user to enter the total amount (in
**** has to be done using C++ please **** **** C++ ****
Exercise 5 Cash Register: Ask the user to enter the total amount (in CAD) of the purchased items. 2. Ask the user to enter the total amount (in CAD) paid by the customer 3. Now, the program should display the exact number of bills to be returned to the customer. Example: Enter the total amount of the bill: 326 Enter the amount paid by the customer: 405 You should return to the customer the following: 100S bills: 0 20S bills: 3 10$ bills: 1 5S bills: 1 1S coins: 4 Exercise 3 Factorial: Read an integer N from the user then display the factorial of this number, N!. Note that, the factorial of a negative number is undefined. In case the user enters a negative number, the program should notify the user and then ask him to enter a positive number instead. Recall that. N, = N * (N-1)* (N-2)* * 2 * 1 Example: Please enter a positive number: 6 The factorial of 6 is: 6!-720 Exercise 4 Product of first N odd numbers: Read an integer N from the user then display the product of all odd numbers smaller than or equal to N (if N is even, it should not be included in the product). Example Please enter a positive number: 7 The product of all odd numbers smaller than or equal to 7 is 1*3*5*7 = 105 Example: Please enter a positive number:6 The product of all odd numbers smaller than or equal to 6 is 113*5 = 15
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started