Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Ubuy online shopping wants to calculate the amount required to purchase new products from their online store. Write a python program to solve the

image text in transcribed
image text in transcribed
3. 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 s 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: Seo 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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

Students also viewed these Databases questions

Question

What lessons in OD contracting does this case represent?

Answered: 1 week ago

Question

Does the code suggest how long data is kept and who has access?

Answered: 1 week ago