Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Need to add arrays to the below program. The program below works, but I'm not sure where to add arrays.

import java.util.Scanner;

/**

 *

 * @author

 */

public class TaxApplication {

    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);     // to read the input

        double wageSalTips;

        double taxableInterest;

        double unempCompPerFunds;

        double adjustedIncome;

        double taxableIncome;

        double federalIncomeTax;

        double EIC;

        double totalPayments;

        double tax;

        double healthcare;

        double totalTax;

        double result;

        int line5 = 10150;

        System.out.println("Welcome to the 1040EZ Tax Form Application");

        System.out.println("1 Wages, salaries, and tips. This should be shown in box 1 of your Form(s) W-2. Attach your Form(s) W-2.");

        wageSalTips = input.nextDouble();

        System.out.println("2 Taxable interest.");

        taxableInterest = input.nextDouble();

        System.out.println("3 Unemployment compensation and Alaska Permanent Fund dividends.");

        unempCompPerFunds = input.nextDouble();

        adjustedIncome = wageSalTips + taxableInterest + unempCompPerFunds;

        System.out.println("4 Add lines 1, 2, and 3. This is your adjusted gross income. $" + adjustedIncome);

        System.out.println("5 If no one can claim you (or your spouse if a joint return), enter $10,150 if single; $20,300 if married filing jointly. See back for explanation. " + line5);

        taxableIncome = adjustedIncome - line5;

        System.out.println("6 Subtract line 5 from line 4. If line 5 is larger than line 4, enter -0-. This is your taxable income. $" + taxableIncome);

        System.out.println("7 Federal income tax withheld from Form(s) W-2 and 1040.");

        federalIncomeTax = input.nextDouble();

        System.out.println("8 Earned income credit (EIC)");

        EIC = input.nextDouble();

        totalPayments = federalIncomeTax + EIC;

        System.out.println("9 Add lines 7 and 8. These are your total payments and credits. $" + totalPayments);

        tax = taxableIncome * 0.15;

        System.out.println("10 Tax. Multiply Line 6 by 0.15. $" + tax);

        System.out.println("11 Health care: individual responsibility");

        healthcare = input.nextDouble();

        totalTax = tax + healthcare;

        System.out.println("12 Add lines 10 and 11. This is your total tax. $" + Math.round(totalTax * 100.0) / 100.0);

        result = totalPayments - totalTax;

        System.out.println("13 Subtract line 12 from line 9. If result is positive, it is your refund.  If result is negative, it is the amount you owe.  $" + Math.round(result * 100.0) / 100.0);

    }

}

Java, Programming

  • Category:- Java
  • Reference No.:- M92397440
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Java

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As