subject

Suppose you want to write an if statement with multiple alternatives to print out someone's tax bracket based on their income. Assume the integer variable income holds the annual income. What is wrong with the following if statement?if (income < 10000)
{
System. out. println("Lowest tax bracket");
}
if (income < 20000)
{
System. out. println("Low-Middle tax bracket");
}
if (income < 30000)
{
System. out. println("Middle tax bracket");
}
System. out. println("High tax bracket");

a) The conditions are in the wrong order; the check for the highest bracket should be first
b) The conditions should use an if else/if else sequence, not just independent if statements
c) The conditions should be a switch statement instead
d) Nothing is wrong - the if statement will correctly print out the tax brackets

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 06:30
Some peer-to-peer networks have a server and some don't. true false
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Select all that apply. what two keys listed below should you use to enter data in an excel worksheet? tab backspace enter right arrow
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Your mom wants to purchase a laptop computer. she said she wants her new computer to be able to play her dvds so she can listen to music and wants to know what type of optical drives will play her disk. which type of drive should she look for?
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
What are some examples of what can be changed through options available in the font dialog box? check all that apply. font family italicizing bolding pasting drop shadow cutting character spacing special symbols
Answers: 2
You know the right answer?
Suppose you want to write an if statement with multiple alternatives to print out someone's tax brac...
Questions
question
Physics, 15.01.2021 03:00
question
Mathematics, 15.01.2021 03:00
question
Chemistry, 15.01.2021 03:00
question
Computers and Technology, 15.01.2021 03:00
question
Mathematics, 15.01.2021 03:00
question
Mathematics, 15.01.2021 03:00
question
Mathematics, 15.01.2021 03:00
question
English, 15.01.2021 03:10
Questions on the website: 13722362