Results 1 to 3 of 3
  1. #1
    kisaragi's Avatar
    kisaragi is offline Member
    Join Date
    Jul 2015
    Posts
    1
    Rep Power
    0

    Default help with multiple class in taxes based on marriage status

    Hello for my homework I was given this problem

    help with multiple class in taxes based on marriage status-22cc3431af88f68c9800d07708306d4e.png

    this is my code so far:

    PHP Code:
    import java.util.Scanner;
    
    public class marriagetax {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		
    		Scanner sc = new Scanner(System.in);
    		String filingStatus;
    		filingStatus = sc.next();
    		
            System.out.println("What is your filing status? Type 'MJ' for married-joint and 'S' for single and 'MS' for married-separately");
            
            System.out.println("What is your annual income?");
            
            double income;
            income = sc.nextDouble();
            
            double marriedjoint;
            double single;
            double marriedseparately;
            
            if (filingStatus.equals("MJ")) {
            	
            	if ((income > 0 && income <=200001)) {
            		marriedjoint = income * .15;
            	}
            	
            	else if ((income > 12000) && (income <200001)) {
            		
            		
            	}
            }
            
            
    
    	}
    
    }
    I'm not sure what else to add in here I'm a little bit confused on how multiple methods work.. any help would be appreciated!

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: help with multiple class in taxes based on marriage status

    If you don't know how multiple methods work then you don't know how methods work. The fact that you have code without any method at all proves it. You need to start studying that.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: help with multiple class in taxes based on marriage status

    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 16
    Last Post: 11-20-2013, 12:43 PM
  2. Writing to file based on checkbox status
    By tej.rljit@gmail.com in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-19-2011, 09:17 PM
  3. calculating taxes in java
    By KAM0002 in forum New To Java
    Replies: 16
    Last Post: 12-08-2010, 11:41 AM
  4. Displaying Multiple Tables based on Input
    By Berzerk in forum New To Java
    Replies: 11
    Last Post: 06-17-2010, 07:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •