Answered step by step
Verified Expert Solution
Question
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
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: e. Accept expense from the user. f. Pass this expense value to the function. g. 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
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