Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment #2

For this assignment you will be writing 3 programs which should be saved independently as their own ".py" file (1 warm-up problem and 2 "on your own" problems). The lename you   should use for each program is outlined in the sections below. When you're nished, you     should submit your programs using the 'Assignments' tool in Brightspace.

You may work by yourself or with a partner. If you choose to work with someone else please be sure to give them credit in your source code and on Brightspace when you submit your work.   Each member of a team must submit their own copy of the assignment to get credit for the       assignment.

Part 0: Lottery Winnings Calculator (Warm-up)

You and your friends just won the lottery (congratulations!) Now you need to gure out how much money everyone is entitled to.

To do this you will be writing a short program that prompts the user for the amount they won, the number of people who are splitting the winnings, and the tax rate that will be applied to   each person's share. Your program should then gure out how much each person will earn    after taxes are applied to each share.

INPUT: Your program accepts the total amount won, the number of people who are splitting the winnings, and the tax rate (as an integer - i.e. 35 = 35%). Ensure that you store your data using variables of the appropriate data type.

OUTPUT: Compute the total amount won, the amount of each share, the tax due on each share and the fi nal take-home amount for each person. Ensure that each of these values is formatted to two decimal places, and that the "comma" separator is included in your currency values, if

necessary.

Sample input/output (user input is highlighted in yellow):

How much money did you win? 1000000

How many people are splitting the winnings? 4

What is the tax rate on lottery winnings (i.e. 25 = 25%): 25

In total you won $1,000,000.00

Split 4 ways that amounts to $250,000.00 per person

Tax per person: $62,500.00

Take home amount per person: $187,500.00

How much money did you win? 5000000

How many people are splitting the winnings? 5

What is the tax rate on lottery winnings (i.e. 25 = 25%): 10

In total you won $5,000,000.00

Split 5 ways that amounts to $1,000,000.00 per person

Tax per person: $100,000.00

Take home amount per person: $900,000.00

Comment your source code and describe your code to someone who may be viewing it for the fi rst time. Also include your name, the date, your class section and the name of your program  at the top of your le. Run your program using the sample values above to ensure that your      program generates the same output.

This program should be named as follows: LastNameFirstName_assign2_part0.py (for example, KappCraig_assign2_part0.py)

Be sure to give credit to your group members by including their names in the commented header of your program!

Part 1: Compound Interest

You've been hired to develop a forecasting tool for a local bank that will let its customers          project how much money they can earn if they invest at their institution. The tool should be       designed to ask the user for how much they want to invest over a 3 year period, as well as the  expected interest rate that they will earn each year and the estimated taxes they will pay on the interest earned. Here's are two sample runnings of the program - user input is highlighted in     yellow for your reference, but you do not need to replicate this in your own program:

**************************************************

3 Year Bank Account Balance Forecast

**************************************************

This program will project how much you could earn by investing money in a bank account

that pays out interest on a yearly basis.

To begin, enter how much money you would like to initially invest (i.e. 5000): 10000

Next, enter the expected interest rate for year 1. For example, enter 5 for 5%: 5

Finally, enter the tax rate on any interest earned this year. For example, enter 15.5

How much will you invest at the beginning of year 2? 10000

What is the expected interest rate for year 2? 6

What is the expected tax rate for interest earned in year 2? 11

How much will you invest at the beginning of year 3? 10000

What is the expected interest rate for year 3? 7

What is the expected tax rate for interest earned in year 3? 12

--- YOUR FORECAST ---

Year

1

2

3

Total

Total

Total

Starting Balance

0.00

10,450.00

21,542.03

Deposit

10,000.00

10,000.00

10,000.00

Interest Earned

500.00

1,227.00

2,207.94

Tax on Interest

50.00

134.97

264.95

deposited:       $30,000.00

interest earned: $3,934.94

taxes due:      $449.92

**************************************************

3 Year Bank Account Balance Forecast

**************************************************

This program will project how much you could earn by investing money in a bank account

that pays out interest on a yearly basis.

To begin, enter how much money you would like to initially invest (i.e. 5000): 100000

Next, enter the expected interest rate for year 1. For example, enter 5 for 5%: 7

Finally, enter the tax rate on any interest earned this year. For example, enter 15.5

How much will you invest at the beginning of year 2? 35000

What is the expected interest rate for year 2? 9

What is the expected tax rate for interest earned in year 2? 12.7

How much will you invest at the beginning of year 3? 0

What is the expected interest rate for year 3? 4

What is the expected tax rate for interest earned in year 3? 10

--- YOUR FORECAST ---

Year

1

2

3

Total