Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-09-2008, 01:39 AM
Member
 
Join Date: Nov 2008
Posts: 5
Rep Power: 0
shongo is on a distinguished road
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);}}




























//
Bookmark Post in Technorati
  #2 (permalink)  
Old 11-09-2008, 03:40 AM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SouthWest Missouri, USA
Posts: 2,229
Rep Power: 4
Norm is on a distinguished road
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.
Bookmark Post in Technorati
  #3 (permalink)  
Old 11-09-2008, 03:56 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,481
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Do not post same question several times in different sub-forums. I've to close this thread and stick with the other one.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
stuck on an assignment starchildren3317 New To Java 11 11-20-2008 12:03 AM
[SOLVED] Stuck in need of help! Zombie_Leg! New To Java 12 09-23-2008 04:18 AM
Stuck in need of help! Zombie_Leg! New To Java 1 09-23-2008 03:22 AM
Stuck on Two Questions, Please Help sylo18 New To Java 5 03-11-2008 02:03 AM
musically stuck cry for help 2 geork New To Java 0 02-07-2008 03:09 PM


All times are GMT +2. The time now is 10:54 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org