if (income <= 10000) tax = income 0.13; else if (income <= 20000) if (income <= 10000) tax = income * 0.1; else if (income > 10000 && income <= 20000) tax = 1000 + %3D tax = 1000 + (income (income - 10000) * 0.15; 10000) * 0.15;

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter4: Making Decisions
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question

Are the following statements equivalent?

if (income <= 10000)
tax = income 0.13;
else if (income <= 20000)
if (income <= 10000)
tax = income * 0.1;
else if (income > 10000 &&
income <= 20000)
tax = 1000 +
%3D
tax = 1000 +
(income
(income - 10000) * 0.15;
10000) * 0.15;
Transcribed Image Text:if (income <= 10000) tax = income 0.13; else if (income <= 20000) if (income <= 10000) tax = income * 0.1; else if (income > 10000 && income <= 20000) tax = 1000 + %3D tax = 1000 + (income (income - 10000) * 0.15; 10000) * 0.15;
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Literals
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
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