Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Family Income Project

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Family Income Project

    Hi Guys i really need help i duno hw to do case 2.. of my program. i duno wats wrong..

    import java.util.*;	
    import java.text.*;
     
     
    public class SDR
     
    {
    static String [] cla={"fs","Jan","Feb","Mar","Apr","May","June","Ju l","Aug","Sept","Oct","Nov","Dec"};
    static Scanner input = new Scanner(System.in).useDelimiter("\r\n");
    static DecimalFormat fmt=new DecimalFormat("0.00");
     
    public static void main(String[] args) 
     
    {
    //declare variables
    int num=0;
    int choice=0,choice2=0;
    double month, euroDollars, exchangeRate, singDollars,salary;
    String person;
    while(choice!=3)
    while(choice2!=12)
     
    {
    System.out.println("*********** Family Income ***********");
    //Menu
    System.out.println(" 1) Enter monthly salary");
    System.out.println(" 2) Display detalied salary by month");
    System.out.println(" 3) Quick glance at monthly salary");
    System.out.println(" 4) Exit");
    //Prompt and Read Choice 
    System.out.print("Please select your choice (1-4): ");
    choice = input.nextInt();
    System.out.println("****************************** ******************** ");	
    System.out.println("");	
    switch(choice)
     
    {
    case 1: //Prompt and Read Inputs	
     
    System.out.print("Enter month (1 for Jan - 12 for Dec): ");
    choice2 = input.nextInt();
    System.out.println("------------------------------------- ");
    System.out.println(""+cla[choice2]+" salary ( max 8 person)" );
     
    do
     
    {	
    System.out.print("Enter person " +(++num)+"(Press ENTER to exit): ");
    person = input.next();
    System.out.print("Enter salary :$ ");
    salary= input.nextDouble();
    }
    while(choice!=3);
    break;
     
    case 2: //Prompt and Read Inputs 
    System.out.print("Enter month (1 for Jan - 12 for Dec): ");
    choice2 = input.nextInt();
    System.out.println("------------------------------------- ");
     
     
     
     
     
     
     
    } 
    }//end of main
     
     
     
    }//end of class
    }
    Attached Images Attached Images
    Last edited by JavaPF; February 1st, 2012 at 05:12 AM. Reason: use highlight tags!


  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Family Income Project

    help please thanks.. U guys rock!

  3. #3
    Member snowguy13's Avatar
    Join Date
    Nov 2011
    Location
    In Hyrule enjoying a chat with Demise and Ganondorf
    Posts
    339
    My Mood
    Happy
    Thanks
    31
    Thanked 48 Times in 42 Posts

    Default Re: Family Income Project

    Make sure to surround your code in highlight tags. This is done like so:

    [highlight=Java]Your code here[/highlight]

    You have cross-posted in this subforum. Cross-posting is allowed between totally different sites, but not in multiple subforums. You should read this.

    Finally, when asking questions, be smart about it. None of us here knows what the problem is with your code; you haven't described what it does. Do you get errors? What is the actual output vs. the expected output?
    Use highlight tags to help others help you!

    [highlight=Java]Your prettily formatted code goes here[/highlight]

    Using these tags makes your code formatted, and helps everyone answer your questions more easily!




    Wanna hear something funny?

    Me too.

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,243
    My Mood
    Hungover
    Thanks
    142
    Thanked 617 Times in 528 Posts

    Default Re: Family Income Project

    I've deleted your duplicate post. Please read this, which you should have done before posting in the introduction forum: This Forum is for Saying Hi, not for Asking Technical Questions (READ BEFORE POSTING)

    Also, please read the link in my signature about asking questions the smart way before you post again.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Junior Member
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Family Income Project

    Quote Originally Posted by snowguy13 View Post
    Make sure to surround your code in highlight tags. This is done like so:

    [highlight=Java]Your code here[/highlight]

    You have cross-posted in this subforum. Cross-posting is allowed between totally different sites, but not in multiple subforums. You should read this.

    Finally, when asking questions, be smart about it. None of us here knows what the problem is with your code; you haven't described what it does. Do you get errors? What is the actual output vs. the expected output?
    I think i know where this guy is coming from. i have got a similar assignment and am stuck at the same point as him.

    So, we are to write a java application over family income.
    A menu of 4 choices, as he showed.

    If choice is 1, user will be promted to enter the month and then to enter the salary earned.
    Total number of person entered should not exceed 8.
    An empty entry on the "Enter person" prompt should allow user to break out of the loop.

    If choice is 2, user will be prompted to enter the month. Detailed information of the month's salary will be listed.

    For example.

    Enter month (1 for jan - 12 for dec) :1
    Family income for Jan :
    Father 2000
    Mother 1500

    Total family income for tge month of Jan is $7800
    ________________________________________

    If choice is 3, the program will generate a list of monthly total salary earned entered for the month so far.

    If choice is 4 the program will display goodbye message and exit the program.

  6. #6
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Family Income Project

    lols... i found it guys iam done with it thanks!

Similar Threads

  1. Family Tree App Help
    By dr85 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 4th, 2011, 02:42 PM
  2. Hello Family
    By Shyamz1 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 10th, 2010, 02:10 PM
  3. Can anyone help me on my project?
    By alesana514 in forum Paid Java Projects
    Replies: 1
    Last Post: December 16th, 2009, 08:24 AM
  4. Need a project
    By helloworld922 in forum Project Collaboration
    Replies: 6
    Last Post: July 31st, 2009, 08:30 AM