Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

3. Computer World wants to calculate the amount required to purchase new laptop for their new staffs. Write a python program to solve the above

image text in transcribed
3. Computer World wants to calculate the amount required to purchase new laptop for their new staffs. 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(expense as a parameter). b. Accept the number of required laptops c. Accept unit price for each laptop using for loop and calculate the total amount of laptops. d. Check the Total amount, if Total amount is less than expense, Display message" Accepted Otherwise display a message "Not Accepted". Also return the value of total amount Outside Function do the following: c. Accept expense from the user. f. Pass this expense value to the function & Display the value returned by the function. Sample Output Enter the expense: 1000 Enter Number of labtops required: 3 Enter the price of a labtop: 200 Enter the price of a labtop: 400 Enter the price of a labtop: 100 Accepted The total amount is: 700.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions