Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using python Ubuy online shopping wants to calculate the amount required to purchase new products from their online store. Write a python program to solve
using python
Ubuy online shopping wants to calculate the amount required to purchase new products from their online store. Write a python program to solve the above problem using fruitful function with parameters and for loop concept. Inside function do the following: a. Create a function with parameter. (Walletamount as parameter). b. Accept the number of products c. Accept unit price of an item using for loop and calculate the totalAmount. d. Check the totalAmount. If totalAmount is less then or equal to Walletamount, Display a message Transaction Approved otherwise display message Not Approved and return the totalAmount Outside Function do the following: e. Accept Walletamount from the user. f. Pass this Walletamount value to the function. g. Display the value returned by the function. Sample Output: Enter the Total Amount in your wallet: 3000 Enter Number of products required: 3 Enter the unit price of a product: 300 Enter the unit price of a product: 500 Enter the unit price of a product: 600 Transaction Approved The Total Required Amount is: 1400.0Step 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