Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:21:53+00:00 2026-06-15T06:21:53+00:00

I am almost complete but when I compile I get the error Method getUserTax

  • 0

I am almost complete but when I compile I get the error “Method getUserTax in class IncomeTax cannot be applied to given types; required double; found: no arguments; reason: actual and formal argument lists differ in length” I’ve gone over my code multiple times and I cannot find where the error is located. It is near the end of the code on the line “userTax = test.getUserTax();

import java.util.Scanner;  //Needed for the Scanner Class
/**
 * Write a description of class IncomeTax here.
 * 
 * @author CD
 * 11/30/2012
 * The IncomeTax class determines how much tax you owe based on taxable income.
 */
public class IncomeTax
{
    private int income;

    /** 
     * The constructor accepts an argument for the income field.
     */
    public IncomeTax(int i)
    {
        income = i;
    }
    /**
    * The setIncome method accepts an argument for the income field.
    */
    public void SetIncome(int i)
    {
        income = i;
    }
    /**
     * The getIncome method returns the income field.
     */
    public double getIncome()
    {
        return income;
    }
    /**
     * The getUserTax returns the tax for the income.
     */
    public static double getUserTax(double income)
    {
        double userTax = 0.10;
        if (income > 250000.0) {
            userTax = 0.35;
        } else if(income > 130000.0) {
            userTax = 0.33;
        } else if(income > 60000.0) {
            userTax = 0.28;
        } else if(income > 30000.0) {
            userTax = 0.25;
        } else if(income > 10000.0) {
            userTax = 0.15;
        }
    return userTax;
}
/**
 * This program uses the IncomeTax class to determine the Income tax for the user's 
income.
 */
public static void main(String [] args)
{
    int userIncome; //To hold taxable income
    double userTax; //To hold tax

    //Create a Scanner object to read input.
    Scanner keyboard = new Scanner(System.in);

    //Get the Personal Income.
    System.out.print("Enter your taxable income and" + "I will tell you the income tax:");
    userIncome = keyboard.nextInt();

    //Create an IncomeTax object with the numeric score.
    IncomeTax test = new IncomeTax(userIncome);

    //Get the income tax.
    userTax = test.getUserTax();

    //Display the income tax.
    System.out.print("Your income tax is" + test.getUserTax());
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:21:54+00:00Added an answer on June 15, 2026 at 6:21 am
    userTax = test.getUserTax();
    

    You need to pass double value as parameter to this call. Your getUserTax method defined as double type parameter required.

    public static double getUserTax(double income)
    

    Example:

    userTax = test.getUserTax(10.0); //Here 10.0 is just for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I 'borrowed' a regex from this website : http://daringfireball.net/2010/07/improved_regex_for_matching_urls that is almost complete but
My project that I've spent almost 40hrs on is almost complete, but I have
I love static analysis and compile-time checks, almost to a fault, but most of
I have an assignment that I think I am almost complete but my head
I have a design I'm working on that is almost complete, but I'm having
I almost have this Powershell script completed but I am stuck at the last
My app is almost complete. In the second snippet of code below, you will
I am making my own installer and it's almost complete. The only thing lacking
I am writing an assignment in MASM32 Assembly and I almost completed it but
I am writing multi-thread socket chat in C++Builder 2009. It is almost complete in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.