Results 1 to 3 of 3
  1. #1
    shongo is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default really stuck now..

    almost done...need help plz..
    need this program to show each category individually...cant do it at all..been at it a week....must be me && and || signs...i think...plz can someone help me as im really stuck now...thank you so much..


    import java.util.Scanner;

    public class assignmentquestion3 {

    public static Scanner key=new Scanner(System.in);

    public static void main(String []args){

    int fullfee=800,newfullfee=3800,associatefee=200,newla diesfee= 2350,ladiesfee= 350,under18fee = 175;
    int selectcat=0;
    int reply = 0;
    int addmember=0;
    int currentfulltotalmem=0,newfulltotalmem=0,associatet otalmem=0,ladiestotalmem=0,under18totalmem=0;
    int assoctotalcash=0,ladiestotalcash=0,under18totalcas h=0;
    int fullprepay=150;
    int ladiesfull=2500;
    int completefull = 0;
    int ladiescurrent=500;
    int under18=175;

    //Main introduction screen for the user and selections available. do while loops only allowing numbers 1,2,3 or 4.
    do{
    do{
    System.out.printf("\n\t %90s","********************Membership Rates For The Golf Club********************");
    System.out.printf("\n\n %105s","This program will allow users to enter details of members as well as calculating and.");
    System.out.printf("\n%106s","outputing the total amount each member should pay. The program allows users to view the");
    System.out.printf("\n%106s","total number of members in each category and the total income for each category.");
    System.out.printf("\n\n\t %75s","Please select your membership category: ");
    System.out.printf("\n\n\t %68s","Please press '1' for FULL");
    System.out.printf("\n\n\t %68s","Please press '2' for ASSOCIATE");
    System.out.printf("\n\n\t %68s","Please press '3' for LADIES");
    System.out.printf("\n\n\t %68s","Please press '4' for UNDER 18");
    System.out.printf("\n\n\t %68s","Please enter 1,2,3 or 4: ");
    selectcat=key.nextInt();
    }while (selectcat>4 || selectcat<1);


    do{
    System.out.printf("\n\n\t %75s","Are you a Current Member (press 1) or a New Member (press 2): ");
    reply=key.nextInt();
    }while (reply<1 || reply>2);



    //if number '1' for 'FULL' category is selected by the user and reply is 'yes'(1) then new full member fee is shown to user







    if (selectcat==1 ||reply==1)

    {
    System.out.printf("\n\n\t %68s","CURRENT FULL MEMBERSHIP SELECTED");

    System.out.printf("\n\n\t %68s","Current full membership fees yearly are "+fullfee+"");
    System.out.printf("\n\n\t %68s","Full members must also pre-pay "+fullprepay+" on a card can be used in the club facilities such as bar and shop ");
    System.out.printf("\n\n\t %72s","The total of this membership is: "+fullfee+"");

    currentfulltotalmem=currentfulltotalmem+1;

    System.out.printf("\n\n\t %72s","The total number of 'CURRENT FULL MEMBERSHIPS = "+currentfulltotalmem+"");


    completefull=completefull+fullfee;
    System.out.printf("\n\n\t %68s","The total amount of income for 'FULL MEMBERSHIPS' within the club = "+completefull+"");



    }


    //if number '1' is selected by the user and reply is 'no' (2) then full member fee is shown to user
    else if (selectcat==1 &&reply==2)

    {
    System.out.printf("\n\n\t %68s","NEW FULL MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","Full membership fees yearly are "+newfullfee+"");



    newfulltotalmem=newfulltotalmem+1;

    System.out.printf("\n\n\t %68s","The total number of 'NEW FULL MEMBERSHIPS = "+newfulltotalmem+"");



    completefull=completefull+newfullfee;
    System.out.printf("\n\n\t %68s","The total amount of income for 'FULL MEMBERSHIPS' within the club = "+completefull+"");



    }



    //if number '2' is selected by the user then associate member fee is shown to user

    if (selectcat==2 &&(reply==1 || reply==2))

    {
    System.out.printf("\n\n\t %75s","ASSOCIATE MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %75s","ASSOCIATE membership fees yearly are "+associatefee+"");


    associatetotalmem=associatetotalmem+1;

    System.out.printf("\n\n\t %75s","The total number of 'ASSOCIATE MEMBERSHIPS' WITHIN THE CLUB = "+associatetotalmem+"");


    assoctotalcash=assoctotalcash+associatefee;
    System.out.printf("\n\n\t %68s","The total amount of income for 'ASSOCIATE MEMBERSHIPS' within the club = "+assoctotalcash+"");




    }


    //if number '3' is selected by the user and reply is 'yes' then new ladies member fee is shown to user

    if (selectcat==3 &&reply==1)

    {
    System.out.printf("\n\n\t %68s","LADIES CURRENT MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","Ladies full membership fees yearly are "+ladiesfee+"");
    System.out.printf("\n\n\t %68s","Ladies must also pre-pay "+fullprepay+" on a card can be used in the club facilities such as bar and shop ");
    System.out.printf("\n\n\t %68s","The total of this membership is: "+ladiescurrent+"");


    ladiestotalmem=ladiestotalmem+1;

    System.out.printf("\n\n\t %75s","The total number of 'LADIES MEMBERSHIPS' WITHIN THE CLUB = "+ladiestotalmem+"");

    ladiestotalcash=ladiestotalcash+ladiescurrent;
    System.out.printf("\n\n\t %68s","The total amount of income for 'LADIES MEMBERSHIPS' within the club = "+ladiestotalcash+"");








    }

    //if number '3' is selected by the user and reply is 'no' then the current ladies member fee is shown to user
    else
    if (selectcat==3 && reply==2)

    {
    System.out.printf("\n\n\t %68s","LADIES NEW MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","LADIES NEW MEMBERSHIP fees yearly are "+newladiesfee+"");
    System.out.printf("\n\n\t %68s","Ladies must also pre-pay "+fullprepay+" on a card can be used in the club facilities such as bar and shop ");
    System.out.printf("\n\n\t %68s","The total of this membership is: "+ladiesfull+"");

    ladiestotalmem=ladiestotalmem+1;

    System.out.printf("\n\n\t %75s","The total number of 'LADIES MEMBERSHIPS' within the club = "+ladiestotalmem+"");

    ladiestotalcash=ladiestotalcash+ladiesfull;

    System.out.printf("\n\n\t %68s","The total amount of income for 'LADIES MEMBERSHIPS' within the club = "+ladiestotalcash+"");

    }


    //if number '4' is selected by the user then under 18 member fee is shown to user

    else if (selectcat==4 &&(reply==1||reply==2))

    {
    System.out.printf("\n\n\t %75s","UNDER 18 MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %75s","UNDER 18 yearly membership fees are "+under18fee+"");}
    System.out.printf("\n\n\t %68s","The total of this membership is: "+under18+"");

    under18totalmem=under18totalmem+1;

    System.out.printf("\n\n\t %75s","The total number of 'UNDER 18 MEMBERSHIPS' within the club = "+under18totalmem+"");

    under18totalcash=under18totalcash+under18;

    System.out.printf("\n\n\t %68s","The total amount of income for 'UNDER 18 MEMBERSHIPS' within the club = "+under18totalcash+"");











    //allowing user to select '0' to add another member or any other key to exit program
    System.out.printf("\n\n\t %68s","Please Press '0' to add another member or any other key to exit.: ");
    addmember=key.nextInt();



    }while (addmember==0 ||addmember>1);}}




























    //

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,516
    Rep Power
    25

    Default

    Can you show us what the program is doing now? Describe what the program is supposed to do, describe what is wrong with its output and what you want the output to look like.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. stuck on an assignment
    By starchildren3317 in forum New To Java
    Replies: 11
    Last Post: 11-19-2008, 11:03 PM
  2. [SOLVED] Stuck in need of help!
    By Zombie_Leg! in forum New To Java
    Replies: 12
    Last Post: 09-23-2008, 03:18 AM
  3. Stuck in need of help!
    By Zombie_Leg! in forum New To Java
    Replies: 1
    Last Post: 09-23-2008, 02:22 AM
  4. Stuck on Two Questions, Please Help
    By sylo18 in forum New To Java
    Replies: 5
    Last Post: 03-11-2008, 01:03 AM
  5. musically stuck cry for help 2
    By geork in forum New To Java
    Replies: 0
    Last Post: 02-07-2008, 02:09 PM

Posting Permissions

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