Question: Program 1 . Investment Calculator: Create a Python program that calculates investment gain a user will get at the end of the investment term. The

Program 1. Investment Calculator: Create a Python program that calculates investment gain a user will get at the end of the investment term. The program should contains the following functions:
main(): call function get_investment_info to get invested amount, invested term in years, and investment annual interest rate; pass the above information to function calc_investment to find the future value and total interest earned by the end of investment term; finally pass all data to display_info so they can be displayed the details on the console.
get_investment_info(): ask user enter invested amount, invested years, and apr, cast them in reasonable data type, and returns them back to caller.
calc_investment(principle, apr, term): received invested amount, invested years, and apr from caller and returns future value and total interest earned back to caller. You may use the following formula to calculate future value. The total interest earned is future value - invested amount.
future value =principle *(1+ apr /12)**(term *12)
total interest earned = future value - principle
4. displayInfo(principle, apr, term, future_value, gain): receives invested amount, invested years, invested apr, future value, and total interest earned from caller and display them in a professional format.
Finally call to run the main() function.
Program 2: Weekly Pay Calculator: An employees total weekly pay equals the hourly wage multiplied by the total number of regular hours worked plus any overtime pay. By default, hours worked beyond 40 are treated as overtime hours and 1.5 times of the regular hourly wage for per overtime hour. Note: Your program should allow user to specify regular hours other than 40 and overtime pay rate other than 1.5 times of regular hourly wage.
Your program should start with a main() function to calls other functions to solve the problem
get_hoursworked_and_hourlyrate(): asks user to enter hours worked and hourly pay rate and returns those numbers to caller
calculate_grosspay(hours_worked, hourly_pay_rate, regular_hour =40, overtime_pay_multiplier =1.5): works on the receiving parameters and returns the calculated result to the caller. If the caller does not pass the regular_hour and/or overtime_pay_multiplier, use the default value 40 and 1.5.
print_pay_stub(hours_worked, hourly_pay_rate, gross_pay): prints out the receiving parameters in accounting format
Finally call to run the main() function.
Requirements for both programs:
1. The program should contain an introductory docstring to describe what the program will do (analysis)and how it will do it (design the program in the form of a pseudo code algorithm)
2. Include suitable prompts for all inputs, and label all outputs appropriately
3. Format the outputs with accounting format. For example 1234.512 dollar should be formatted as $1,234.51
4. After you have coded a program, be sure to test it with a reasonable set of legitimate inputs
5. Submit the .py files here for grading

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!