Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 3 ( 3 5 marks ) For this task, you are to write code that calculates the maximum yearly income tax given by an
Task marks
For this task, you are to write code that calculates the maximum yearly income tax given by an individual within a period of multiple years.
Instructions
Your program should first ask the user to input a number of years. The program should then repeatedly ask the user to input a yearly tax amount until the specified number of years is reached. Finally, the program should output the maximum yearly income tax of the user based on the input values.
Hint: consider which form of aggregation might be appropriate for solving this problem.
If the user inputs zero for the number of years, the program should output a friendly message informing the user that maximum tax could not be calculated.
Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:
You must choose appropriate data types for user input.
Your solution must not crash if the user inputs zero for the number of years.
Your solution must be implemented using a while loop.
You must indicate which year the input is for as part of your income tax prompt see example runs
You must not use any conpcets not covred yet
Solve using while loop only and do the coding in python only.
Don't use try and except in python, solve by using only while loops
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