Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help my Problem # 1 (5 marks) The ministry of Higher Education wants you to create a program that will compute for the students' retention.
help my
Problem # 1 (5 marks) The ministry of Higher Education wants you to create a program that will compute for the students' retention. The program should read the following inputs: name of college, total number of students and number of postponed students. Be able to meet the requirements below: a. Create an anonymous function that will compute the retention. The retention is computed as total number of students minus the number of postponed students. b. The ministry needs to know the allowance of enrolled students for 7 months. Create another function which is a recursion program that will print the allowance, the number of months (starting from 1 to 7) and the name of the college. The allowance is computed as total number of students multiplied to 80. C. Call the anonymous function and your recursion function to the main program. Sample output: Enter name of college: :Shinas Enter number of enrolled students : 2560 Enter number of postponed students : 120 Retention : 2440 204800 1 Shinas 204800 2 Shinas 204800 3 Shinas 204800 4 Shinas 204800 5 Shinas 204800 6 Shinas 204800 7 Shinas Page 1 of 2 Problem #2 (5 marks) A program to compute the income for Honda cars is already given below. The income is computed as number of cars sold multiplied to sales amount. Some modifications need to be added to the program based on some conditions. Add a decorator that will do the following: a. If the number of cars sold is more than 5, apply a new computation which is, number of cars sold multiplied to sales amount multiplied to 0.25 b. If the sales amount is more than 9500, apply a new computation which is number of cars sold multiplied to sales amount minus 20. C. If none of the new conditions are met, apply the old computation. def computeIncome (ncars, smount): return ncars smount NumberOfcars = int (input ("Enter number of cars sold:")) SalesAmount = float (input ("Enter sales amount:")) print ("Income: ", compute Income (NumberOfcars, SalesAmount))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