Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions