1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lana66690 [7]
2 years ago
7

My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based

on three given criteria:
> for a salary between 10,000 and 20,000, tax is at 1%
> for a salary between 20,000 and 30,000, tax is at 2%
> for a salary greater than 30,000, tax is at 3%
> there is no tax otherwise

Criteria 1 and 2 seem to overlap because of 20,000. How can I solve this? Thanks!
Computers and Technology
1 answer:
Goryan [66]2 years ago
8 0

Answer:

user_salary = int(input("Please Enter Your Salary : "))

if user_salary in range(10000, 20000):

   print("Tax = ",int(user_salary/100*1))

elif user_salary in range(20000, 30000):

   print("Tax = ",int(user_salary/100*2))

elif user_salary in range(30000, 40000):

   print("Tax = ",int(user_salary/100*3))

else:

   print("No Tax!")

Explanation:

You might be interested in
An online company wants to conduct real-time sentiment analysis about its products from its social media channels using SQL.
iogann1982 [59]

Answer:

An online company wants to conduct real-time sentiment analysis about its products from its social media channels using SQL. The solution which has lowest cost and operational burden is as follow:

B. Configure the input stream using Amazon Kinesis Data Streams. Use Amazon Kinesis Data Analytics to write SQL queries against the stream.

Explanation:

  • The option A is not correct as this solution doesn't have lowest cost and operational burden as set up a streaming data ingestion application on Amazon EC2 and connect it to a Hadoop cluster for data processing will have more cost and operational burden.
  • The lowest cost and operational burden solution is that we configure input stream using Amazon Kinesis Data Streams. We can use Amazon Kinesis Data Analytics to write SQL queries against the stream.
  • The option c and d are also more pricey in terms of cost and operational burden as compared to Amazon Kinesis Data stream and analytics.  

4 0
3 years ago
In the Happy Valley School System, children are classified by age as follows:less than 2, ineligible2, toddler3-5, early childho
Greeley [361]

Answer:

int age = 10;

switch (age){

case 0:

case 1:

System.out.println("ineligible");

break;

case 2:

System.out.println("toddler");

break;

case 3:

case 4:

case 5:

System.out.println("early childhood");

break;

case 6:

case 7:

System.out.println("young reader");

break;

case 8:

case 9:

case 10:

System.out.println("elementary");

break;

case 11:

case 12:

System.out.println("middle");

break;

case 13:

System.out.println("impossible");

break;

case 14:

case 15:

case 16:

System.out.println("high school");

break;

case 17:

case 18:

System.out.println("scholar");

break;

default:

System.out.println("ineligible");

}

Explanation:

In java and many other programming languages, a switch statement is a way of having multiple branching options in a program. This is usually considered a more efficient way than using multiple if....else if statements. and the expression variables could be byte, char int primitive data types. etc. every branch (option) in a switch statement is followed by the break statement to prevent the code from "falling through". In the question The variable age is declared as an int and initialized to 10. and tested against the conditions given in the question.

7 0
3 years ago
At which stage should James, a website designer, gather information about the website he wants to create, and at which stage sho
viva [34]
<h2>Answer: James should gather information in the <u><em>Learning</em></u> phase and begin the site’s coding in the <u><em>Development</em></u> phase.</h2>

8 0
3 years ago
Which of the statements below is false? Question 19 options: a) You can install a 64-bit operating system on a 64-bit machine. b
diamong [38]

you can install a 64 bit operating system on a 32 bit machine.

hope this helps!

5 0
3 years ago
Which is an acceptable practice when a photographer shoots in windy conditions?
VARVARA [1.3K]

Answer:

d) attach a bag of weights to the tripod

Explanation:

5 0
3 years ago
Other questions:
  • While moving into a new apartment, Titus needed to hold the door open with something heavy. It suddenly dawned on him that he co
    9·1 answer
  • Airbags only absorb the _____ impact in a crash. initial final mid-stage smallest
    13·1 answer
  • Isaac is researching Abraham Lincoln’s life for a social studies report. He finds an encyclopedia that includes original letters
    5·2 answers
  • Describe three perimeter intrusion detection systems and give an example of one that you have seen deployed either at work or an
    8·1 answer
  • Time
    6·1 answer
  • Essay about evolution of media shaped the values and norms of the society
    11·1 answer
  • 31
    10·1 answer
  • Fictional Corp has a data center that runs multiple internal applications. However, they want to migrate their email to a cloud
    9·1 answer
  • Electronic résumés have an attractive, highly formatted appearance. please select the best answer from the choices provided t f
    14·2 answers
  • When you insert a new slide in a presentation, where is it placed in relation to the existing slides?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!