Results 1 to 14 of 14
  1. #1
    nag2007 is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default I really need help!

    Hi,

    I am in a computer science 1 class which is a beginners java course. I am a Math major, but I need to have this class in order to proceed with my major. I am having a hard time with this class and I was just wondering if someone could help me pass this class?

    Thank you for your time.

    PS
    I have attached my assignment.
    Attached Files Attached Files

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Hello, and welcome to the forum.

    So in essence what you've done is to give us your entire assignment without asking a question, and I'm afraid that in this situation there's not much that we can do for you other than to direct you to a tutorial or two.

    I suggest that you post your best solution that you've created so far, and ask as specific questions as possible, and we'll be much better able to help. If you really have no idea how to begin here, then please have a look here: Starting Writing a Program. It's a well-written article that can help.

    Much luck and again, welcome.

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

  4. #4
    nag2007 is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    I am having a hard time putting a method inside a method. here is what I have so far.
    Attached Files Attached Files

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm sorry to say this, but you should consider scrapping that code and start over as it's full of errors and may not be easily correctable. One thing I recommend to all newbie programmers is that you compile early and often. In fact if you are not using an IDE, you should compile your code after adding each new line or after changing any line. Then if the code doesn't compile, don't add any new code until you've fixed the compile error. If you don't do this, you'll end up with nothing but a rat's nest of errors.

    Start out with a code skeleton like so:
    Java Code:
    public class LogIn
    {
    
    }
    Compile the skeleton and fix any errors. Then if your class will have a main method, add just that:
    Java Code:
    public class LogIn
    {
       public static void main(String[] args)
       {
    
       }
    }
    and again compile and fix. Then add variable declarations and compile and fix, etc... so by successive steps, you have code that you know will at least compile.

    My next suggestion is that when you post code here, you post the code into the forum and not upload a file as you've done. The easier you make it for other's to read your code, the more folks will be willing to read it. Don't forget to use code tags when posting code here (see my signature for a link on this).

    Finally, you might wish to contact your teacher to arrange some one-on-one time to get you caught up as it looks like (at least from your code) that you're quite a bit behind in this class.

    Much luck

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    When is this assignment due, by the way?

  7. #7
    nag2007 is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    Tomorrow at midnight. Its a required course for my major and I just have to take one.

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by nag2007 View Post
    Tomorrow at midnight.
    You're kind of starting late, and if possible, you should request an extension.

    Its a required course for my major and I just have to take one.
    I'm not trying to be rude, but this statement may not help your cause here, since most of us are motivated to help out of love of Java. The ones we like helping the most are the ones who show desire and effort to learn the language, rather than the ones who are trying to just get by. Again, you'll likely get help here, but realize that usually the more effort you show, the more help you'll likely get. Again, much luck.

  9. #9
    nag2007 is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    I have been working on this for a week now and I have put hours into. I have also re-written it many times. And asking my teacher for help is no help at all. Its a complete waste of my time. I am sorry that this is not something that I want to do for the rest of my life. But I do want learn and I would really like to get an A class so that is way I am here. I want to learn, and I want to do a great job in the class. And I am sorry if I gave off the wrong vibe. But I really do need a little more help understanding this stuff. It just doesn't click in my mind.

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Looking through your assignment, it appears that the class skeleton has already been made for you. Just get rid of the ellipses "..." in the empty methods like so:
    Java Code:
    public class LogIn
    {
      public static boolean isValidPwd(String pwd) 
      {
        boolean valid = false;
        // TODO: fill in
        
        return valid;
      }
      
      public static boolean isValidUsrName(String pwd) 
      {
        boolean valid = false;
        // TODO: fill in
        
        return valid;
      }
      
      public static boolean login(String usrName, String pswd) 
      {
        boolean successful = false;
        // TODO: finish
        
        return successful;
      }
      
      public static void saveUser() 
      {
        
      }
      
      public static void main(String[] args)
      {
    
      }
    }
    Now what you have to do is work on each method, one at a time. Get one method to work (testing it in the main method with simple tests) before working on the next. Through small steps you'll succeed.

    Again, read or re-read this article which can help crystallize the steps you'll need to solve this puzzle: Starting Writing a Program
    Last edited by Fubarable; 10-12-2009 at 07:18 AM.

  11. #11
    nag2007 is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    And I really do appreciate your help.

  12. #12
    nag2007 is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    and also before the public static boolean isValidPwd(String pwd) she told us to put
    public static (Space, she didnt say what to put here) register (and again didn't say what to put here) and then string = userName
    (isValidUserName(userName) == true.

  13. #13
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    "I'm not trying to be rude, but this statement may not help your cause here, since most of us are motivated to help out of love of Java. The ones we like helping the most are the ones who show desire and effort to learn the language, rather than the ones who are trying to just get by. Again, you'll likely get help here, but realize that usually the more effort you show, the more help you'll likely get. Again, much luck." -Fubarable

    I have never read a more apt statement on these forums. =)
    My Hobby Project: LegacyClone

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

    Default

    Quote Originally Posted by nag2007 View Post
    and also before the public static boolean isValidPwd(String pwd) she told us to put
    public static (Space, she didnt say what to put here) register (and again didn't say what to put here) and then string = userName
    (isValidUserName(userName) == true.

    You mean another method?

    This is a method.

    ublic static boolean isValidPwd(String pwd)
    And then you define another method with some parameters and return type and call another method.

    public static (Space, she didnt say what to put here) register (and again didn't say what to put here) and then string = userName
    (isValidUserName(userName) == true.

Posting Permissions

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