Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(10 marks) 3. Almaha shop wants to calculate the amount required to purchase new products to be available in their store. Write a python program

image text in transcribed
(10 marks) 3. Almaha shop wants to calculate the amount required to purchase new products to be available in their 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 (allocated amount as a parameter). b. Accept number of required products. c. Accept unit price of each new product using for loop and calculate the Total Amount. d. Check the TotalAmount, if the TotalAmount is less than the allocated Amount, then display the message "Approved" Otherwise display the message "Not Approved". Also return the value of TotalAmount. Outside Function do the following: e. Accept allocated amount from the user. f. Pass this allocated amount value to the function. g. Display the value returned by the function. Sample Output Enter your Allocated Amount: 2000 Enter Number of products required: 3 Enter the unit price of an product: 400 Enter the unit price of an product: 500 Enter the unit price of an product: 300 Approved The Total Required Amount is: 1200.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

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago