Hi,

I need help with a timetable which must do the following:

1: Input: program name Output: list of core and option modules.
2: Input: module name Output: module leader, activities, credits, when run, constraints
3: Input: activity name Output: room(s)
4: Input room number Output size, condition, available resources
5: Input module leader Output constraints

Ive started the code but i need help with a case menu which would work like shown above but ive tried myself but am having some difficulty with it

Thanks

Recommended Answers

All 23 Replies

Post the code that you have and what problems you are encountering. Please put [ code] tags around any code you post.

Hey Ezzaral,

Its quite large could i send you it in a private message? I am using BlueJ as well to do my Java

Try to narrow the relevant code section if it is overly large or provide a skeletal portion of it as needed and post it here. Questions should generally be kept on the forums so that all can participate or view the suggestions offered. Personally I never provide code help via PM.

Ok thanks dude, ive sent you a PM with my code and what ive done so far

As I've indicated twice now, you need to post the code here and specific questions about what you are having trouble with. "Having trouble with case menu" isn't all that specific. What piece do you not understand about it?

dont understand how to get it to print my options out

or is there a simple solution to get my code to work

Thanks

You still haven't posted the code here.

could you not help me ezzaral as i dont want to post my code

He said he will not help you via PM. To summarize:
post your code in the forum, only relevant parts
ask specific question
also remember to use [code] [/code] tags

Need help with case menu please:

public void menu() {
       int x;
       do {
          printOptions();
          switch(x) {
             case 1: addPrograms (); break; 
             case 2: listModules(); break;
             case 3: addModules(); break;
             case 4: listModuleLeaders(); break;  
             case 5: addActivitys(); break;
             case 6: listRooms(); break;
             case 7: addRooms() ; break;
             case 8: listResources() ; break;
             case 9: addModuleLeaders(); break;
             case 10: listConstraints(); break;
             case EXIT: exit();
          }
       }while(x!=EXIT);
    }
        
     protected void printOptions() {
        System.out.println("1: Add Program");
        System.out.println("2: List Modules");
        System.out.println("3: Add Modules");
        System.out.println("4: List Modules");
        System.out.println("5: Add Activity");
        System.out.println("6: List Room");
        System.out.println("7: Add Rooms");
        System.out.println("8: List Reources");
        System.out.println("9: Add Module Leaders");
        System.out.println("10:List Constraints");
        System.out.println(EXIT+": Exit");
    }
    
}

Use Scanner to readInt() input after printOptions() and you will be all set.

could you post what the code would look like thanks

Read the API link. There are a few examples right there in the class description.

Hi,

I am still having trouble if someone would contact me via PM. I will send them my code and what i need help with. As its quite large

Thanks

Relatively speaking, no, your code is not "quite large". Post it here if you have questions about it. Forum rules dictate that requests for help should remain in the forums so all may participate.

i want to PM you Ezzaral as it maybe a simple fix

commented: You have been told countless times that questioon for help should remain in the forum and he has said he will not help you via PM -1

Ive been having some other errors which include a problem with a read int but i think that ive solved it i think. But ive got an error with my case menu. It says that the add program cannot have a string value in it. My code is below which is the only thing that relates to what is being shown:

public void setProgram(String addProgram) {
    program=addProgram;

the error is

addProgram(java.lang.String)in Staff cannot be applied to()

The error is occurring because you have tried to call addProgram(), which has no parameters defined, with a string parameter i.e. addProgram("some string"). You need to either change that call to have no parameter, or change the method to take a string parameter.

how would i do either and thanks for your reply Ezzaral

You simply change whichever one you need to. If addProgram() doesn't need a parameter, then leave it as is and make sure that you don't put a string parameter in when you call it. If it does need to take a string parameter, you need to declare that parameter in the method signature

public void addProgram(String program)

hey can u send the time table code for me?????

my mail id is lummox@rediffmail.com

????

plz if u ???????

commented: Pathetic. -1
commented: Don't be lazy -1

hey can u send the time table code for me?????

my mail id is <removed>

????

plz if u ???????

That is not the purpose of these forums. Do your own homework.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.