Question

In: Computer Science

In this SLP assignment, we will get more practice with the concepts we have learned. Read...

In this SLP assignment, we will get more practice with the concepts we have learned.

Read the following requirements, first write pseudo code based on your understanding, and then develop a Java application program based on your pseudo code.

  1. The program will first ask users to key in their taxable annual income.
  2. Depending on the income level, the program will calculate the tax owed. Using the following table as reference:

Income tax bracket percentage:

0–$8,500: 10%

$8,500–$34,500: 15%

$34,500–$83,600: 25%

$83,600–$174,400: 28%

$174,400–$379,150: 33%

$379,150 and above: 35%


Hint: use the following as reference to write if and else statement.

can someone help me complete this pleasee

Solutions

Expert Solution

Algorithm:

Code:

import java.io.BufferedReader;
import java.io.InputStreamReader;


public class TaxCalculator {
   public static void main(String[] args){
       try{
           BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
           /*
           * getting user taxable income
           */
           System.out.println("Enter your taxable income: ");
           double income = Integer.parseInt(br.readLine());
           /*
           * initialiazing tax amount to 0
           */
           double tax = 0.0;
           /*
           * calculating tax for various income groups
           */
           if(income > 0 && income <= 8500){
               tax = income * 10 / 100;
           }
           else if(income > 8500 && income <= 34500){
               tax = income * 15 / 100;
           }
           else if(income > 34500 && income <= 83600){
               tax = income * 25 / 100;
           }
           else if(income > 83600 && income <= 174400){
               tax = income * 28 / 100;
           }
           else if(income > 174400 && income <= 379150){
               tax = income * 33 / 100;
           }
           else if(income > 379150){
               tax = income * 35 / 100;
           }
          
           /*
           * displaying tax amount
           */
           System.out.println("Your tax amount: " + tax);
       }
       catch(Exception e){
           e.printStackTrace();
       }
   }
}

code screenshot:

Output:


Related Solutions

Last week we learned more about important concepts in the area of Distribution and about the...
Last week we learned more about important concepts in the area of Distribution and about the job of Revenue Manager. Two of the most heavily negotiated points in the distribution channel agreements are Last Room Availability and Rate Parity. Which of these do you feel is the most beneficial to the hotel, and why?
In this assignment, you are asked to begin to pull together the marketing concepts we have...
In this assignment, you are asked to begin to pull together the marketing concepts we have been discussing and to think ahead. Entrepeneurship is really a concept of evolution, an idea that often begins as a small business. Before it became Walmart was we know it, Sam Walton's store began in a small town in Arkansas. A similar history exists for McDonald's -- a small hamburger stand in California. In the auto industry, the Dodge Brothers really did exist. Look...
In this assignment please relate one of the following economic concepts we have discussed to a...
In this assignment please relate one of the following economic concepts we have discussed to a personal experience you have had since the COVID-19 pandemic began. Chapter 1: marginal analysis Chapter 2: trade off Chapter 3: a shift in supply and demand (book: Hubbard and O'Brien 3rd edition Macroeconomics) Your assignment should explain the concept you chose and how it relates to a personal experience over the past couple weeks. I would recommend your response contain 2-5 paragraphs in to...
For this assignment, you will identify the main concepts and terms learned in this week’s online...
For this assignment, you will identify the main concepts and terms learned in this week’s online lectures and textbook readings(Attraction, Friendship, and Love Understanding Relationships Helping Others) and create a fictional case study (may not be related to actual individuals). You will use the following guidelines while writing your case study: Background: You need to describe the demographics of individuals involved in the case study such as their age, gender, occupation, education, relationships, and family history. The case story: You...
For this week’s Written Assignment, you have a chance to practice your critical thinking skills. Read...
For this week’s Written Assignment, you have a chance to practice your critical thinking skills. Read the Loyalty Dilemma Case Study https://my.uopeople.edu/pluginfile.php/847836/mod_workshop/instructauthors/12.135.Harry%20Markham%20%28A%29.Minahan.pdf and write an analysis. The goal is to demonstrate critical thinking in your analysis; you do not need to become an accounting expert to critically analyze this case study. In your analysis, be sure to include: A summary of the issue. Use of at least one critical thinking strategy or tool to analyze the situation and highlight key...
Java Programming Assignment 6-1 We have covered the “Methods” this week. Apply the concepts that we...
Java Programming Assignment 6-1 We have covered the “Methods” this week. Apply the concepts that we have learnt in class and come up with a “problem scenario” for which you can create a “solution”. Utilize any/all of the examples from the book and class that we discussed. You program should be interactive and you should give a detailed statement about what the “description of the program – purpose and how to use it”. You should also use a “good bye”...
Hi, I am working on this assignment where we have to read and write to a...
Hi, I am working on this assignment where we have to read and write to a file. Change any code that needs to be changed, I need the wfile and rfile functions to be edited to work and the rest of the program. please change the gets() to something that works. if I need to create a .txt file to run the program pls let me know Thanks in advance for the help //agalloc.c // maintains list of agents infile,...
Using the various tools and concepts we have learned thus far, recreate the following three UI...
Using the various tools and concepts we have learned thus far, recreate the following three UI Elements. Exact measurements have not been given so that you may explore scaling and sizing. UI Element UI Element UI Element For some of the more complex shapes, it is best to break them down into simpler shapes. For example, a magnifying glass is really just a circle with a diagonal line. Purpose To understand how Illustrator is used to design UI Elements
Analyze a real government policy in the context of the macroeconomic concepts we learned in class....
Analyze a real government policy in the context of the macroeconomic concepts we learned in class. Describe the economic problem this policy attempted to tackle and the intended macroeconomic goals.Explain who were the agents pushing this policy forward. Who opposed the policy? What was the incentive framework of the main agents involved before the policy was implemented? And what was the incentive framework implied by the policy? You must be able to identify groups of people with similar background or...
READ THE FOLLOWING CAREFULLY TO GET FULL VALUE FROM THE PRACTICE. IF NOT COMFORTABLE WITH CLASSES,I...
READ THE FOLLOWING CAREFULLY TO GET FULL VALUE FROM THE PRACTICE. IF NOT COMFORTABLE WITH CLASSES,I WOULD START WITH DEFINING THE CLASS WITH ONE constructor AND GO FROM THEREUse the following to calculate a GPA (the following is for calculation information only):A = 4.00 grade points per credit hourA- = 3.70 grade points per credit hourB+ = 3.33 grade points per credit hourB = 3.00 grade points per credit hourB- = 2.70 grade points per credit hourC+ = 2.30 grade...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT