Question
This project you cant use functions, lists, tuples and dictionaries are NOT allowed in your code. Problem (filename: project_01.py): As everybody knows, Santa and the
This project you cant use functions, lists, tuples and dictionaries are NOT allowed in your code. Problem (filename: project_01.py): As everybody knows, Santa and the elves live at the north pole. The north pole has been recently claimed by several countries, among them Canada, Greenland, Norway, and USA. Living on a national territory, the elves now face the problem that they have to pay tax for their income. Luckily, due to the concurrent claims of the countries, they can chose which tax model they want to have applied. The tax models, a specific north pole edition, are as follows (for simplicity, all currencies are in Euro): - Canada: 26% flat tax - Denmark: first 1000 Euro no tax, 10% on the second 1000 (in addition to it), 20% on the third 1000 (in addition to it), and so on... - Norway: 10% taxrate on the first 3000 Euro, then 40% on everything above that. - U.S: The overall tax is 12% if the income is equal or lower to 1500 Euro. If the income is higher than 1500 and less than or equal to 6000 the tax rate is 25%. If the income is higher than 6000 but lower or equal to 10000 the tax is 38%. If the income is higher than 10000, the tax rate is 15% on the whole thing. (sidenote: yes this is a stupid system, no it is not like this in reality). Write a program for Santa and the elves that recommends the best tax model for a given income. The program should read in the income and print out the lowest amount of tax they have to pay, and the country that has the lowest tax. If more than one country offer the lowest tax, print all of those countries alphabetically seperated by a space. The program should continue to ask for income and give tax-advice until the user inputs a negative number. The input should be an int, while the output is a float (since the tax-rates are floats).
As an example, for an income of 6100 Euro, the calculations would be: Canada: 0.26 * 6100 = 1586.0 Denmark: 0.0 * 1000 + 0.1 * 1000 + 0.2 * 1000 + 0.3 * 1000 + 0.4 * 1000 + 0.5 * 1000 + 0.6 * 100 = 1560.0 Norway: 0.1 * 3000 + 0.4 * 3100 = 1540.0 USA: 0.38 * 6100 = 2318.0 Examples: Income: 6100 Lowest tax: 1540.0 Norway Income: 9000 Lowest tax: 2340.0 Canada Income: 2000 Lowest tax: 100.0 Denmark Income: -1 Income: 1000 Lowest tax: 0.0 Denmark Income: 2000 Lowest tax: 100.0 Denmark Income: 3000 Lowest tax: 300.0 Denmark Norway Income: 4000 Lowest tax: 600.0 Denmark Income: -100 Income: -1 Income: 5500 Lowest tax: 1250.0 Denmark Income: 8900 Lowest tax: 2314.0 Canada Income: 12000 Lowest tax: 1800.0 USA Income: -1 Income: 1000000 Lowest tax: 150000.0 USA Income: 6000 Lowest tax: 1500.0 Denmark Norway USA Income: -1
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