Results 1 to 3 of 3
Thread: really stuck now..
- 11-09-2008, 12:39 AM #1
Member
- Join Date
- Nov 2008
- Posts
- 5
- Rep Power
- 0
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);}}
//
- 11-09-2008, 02:40 AM #2
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.
- 11-09-2008, 02:56 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Do not post same question several times in different sub-forums. I've to close this thread and stick with the other one.
Similar Threads
-
stuck on an assignment
By starchildren3317 in forum New To JavaReplies: 11Last Post: 11-19-2008, 11:03 PM -
[SOLVED] Stuck in need of help!
By Zombie_Leg! in forum New To JavaReplies: 12Last Post: 09-23-2008, 03:18 AM -
Stuck in need of help!
By Zombie_Leg! in forum New To JavaReplies: 1Last Post: 09-23-2008, 02:22 AM -
Stuck on Two Questions, Please Help
By sylo18 in forum New To JavaReplies: 5Last Post: 03-11-2008, 01:03 AM -
musically stuck cry for help 2
By geork in forum New To JavaReplies: 0Last Post: 02-07-2008, 02:09 PM


LinkBack URL
About LinkBacks

Bookmarks