Write a function called calculate_tax that takes 3 arguments: your age, salary, and current job designation. Your first task is to take these arguments as user input and pass these values to the function. Your second task is to implement the function and calculate the tax as the following conditions: • NO TAX IF YOU ARE LESS THAN 18 YEARS OLD. • NO TAX IF YOU ARE THE PRESIDENT OF THE COMPANY • No tax if you get paid less than 10,000 • 5% tax if you get paid between 10K and 20K • 10% tax if you get paid more than 20K Finally return this tax value. Then print the returned value in the function call.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 13E
icon
Related questions
Question

Must show it in Python:

Please show step by step with comments.

Please show it in simplest form.

Input and Output must match with the Question

Please go through the Question very carefully.

Example2:
Input:
20
18000
assistant manager
Function Call:
calculate_tax(20, 18000, 'assistant manager')
Output:
900.0
=====:
===== ====
Example3:
Input:
20
22000
assistant manager
Function Call:
calculate_tax(20, 22000, 'Assistant manager')
Output:
2200.0
====
Example4:
Input:
20
122000
president
Function Call:
calculate_tax(20, 122000, 'president')
Output:
Transcribed Image Text:Example2: Input: 20 18000 assistant manager Function Call: calculate_tax(20, 18000, 'assistant manager') Output: 900.0 =====: ===== ==== Example3: Input: 20 22000 assistant manager Function Call: calculate_tax(20, 22000, 'Assistant manager') Output: 2200.0 ==== Example4: Input: 20 122000 president Function Call: calculate_tax(20, 122000, 'president') Output:
Task 5
Write a function called calculate_tax that takes 3 arguments: your age, salary, and current job designation.
Your first task is to take these arguments as user input and pass these values to the function.
Your second task is to implement the function and calculate the tax as the following conditions:
• NO TAX IF YOU ARE LESS THAN 18 YEARS OLD.
• NO TAX IF YOU ARE THE PRESIDENT OF THE COMPANY
• No tax if you get paid less than 10,000
• 5% tax if you get paid between 10K and 20K
• 10% tax if you get paid more than 20K
Finally return this tax value. Then print the returned value in the function call.
Hints:
Here the job designation is a string, so it can be written in both uppercase and lower cases. So, you need to check the value ignoring the case.
=====
==============
Example1:
Input:
16
20000
Student
Function Call:
calculate_tax(16, 20000, 'Student')
Output:
========
===========
Transcribed Image Text:Task 5 Write a function called calculate_tax that takes 3 arguments: your age, salary, and current job designation. Your first task is to take these arguments as user input and pass these values to the function. Your second task is to implement the function and calculate the tax as the following conditions: • NO TAX IF YOU ARE LESS THAN 18 YEARS OLD. • NO TAX IF YOU ARE THE PRESIDENT OF THE COMPANY • No tax if you get paid less than 10,000 • 5% tax if you get paid between 10K and 20K • 10% tax if you get paid more than 20K Finally return this tax value. Then print the returned value in the function call. Hints: Here the job designation is a string, so it can be written in both uppercase and lower cases. So, you need to check the value ignoring the case. ===== ============== Example1: Input: 16 20000 Student Function Call: calculate_tax(16, 20000, 'Student') Output: ======== ===========
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning