Results 1 to 17 of 17
Like Tree1Likes
  • 1 Post By Dark

Thread: need a lot of java help!!!

  1. #1
    beta4 is offline Member
    Join Date
    Feb 2011
    Posts
    17
    Rep Power
    0

    Default need a lot of java help!!!

    1. what is an instance of a class?
    2. how do create one?
    3. i'm doing an assignment and these are the instructions:

    Create a "GradeBook" class for a teacher that has a Studentís Last Name, First Name, ID, and places for five test grades and six assignment grades. From this class create an instance of it. Now, in an effort to preserve the work of the student from year to year, we need to create an immutable class called LastYearsGrades. From that class create an instance for MathI + the previous year (e.g., MathI2010 for last yearís math grades). Fill that grade book with the grades from the first instance of the grade book class that you created.

    havent been able to get help from my teacher (busy with all the other students that need help) so i'm coming here. i need advice, tips, hints, anything, and everything. like, for starters, i dont even know where to start. i also have to make a uml. please help and thank you. if i dont reply to your post right away its because im trying to read from my text book and watch video notes at the same time.

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

    Default

    Quote Originally Posted by beta4 View Post
    1. what is an instance of a class?
    2. how do create one?
    This is best answered at the Java tutorials which you can find here:
    Java Tutorials Really Big Index


    3. i'm doing an assignment and these are the instructions:

    Create a "GradeBook" class for a teacher that has a Studentís Last Name, First Name, ID, and places for five test grades and six assignment grades. From this class create an instance of it. Now, in an effort to preserve the work of the student from year to year, we need to create an immutable class called LastYearsGrades. From that class create an instance for MathI + the previous year (e.g., MathI2010 for last yearís math grades). Fill that grade book with the grades from the first instance of the grade book class that you created.
    Before asking a question like this it is always best to try it first, or failing that, ask as specific a series of questions about specific points of confusion as you can. Else we have no idea where your problem likes.


    havent been able to get help from my teacher (busy with all the other students that need help) so i'm coming here. i need advice, tips, hints, anything, and everything. like, for starters, i dont even know where to start. i also have to make a uml. please help and thank you. if i dont reply to your post right away its because im trying to read from my text book and watch video notes at the same time.
    Your best bet is to study, study, and do more study. Best of luck.

  3. #3
    SHE
    SHE is offline Member
    Join Date
    Mar 2011
    Posts
    27
    Rep Power
    0

    Default

    My teacher always advice me .. when you start working in program .. forget the code first of all .. draw your problem .. understand it .. and think step by step about each code .. read .. write .. design ..implement .. !


    first of all the program look like this one

    Student Details /

    First Name :
    Last Name :
    ID :
    Test One :
    Test Two :
    Test Three:
    Test Four :
    Test Five :

    A1
    A2
    A4
    A4
    A5
    A6

    this first step when you finished created all these requires to your program start to read the new requirement ..

    HINT : any time you see a (FIXED)collection .. Try to use array / arraylist.

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    As previously stated. Think about the problem first, read it over a few times until you fully understand the question. Then plan about what you need(learn what classes and objects are) then think about what you will need to manage the assignment. The more understanding you have the easier answering it will be. While having your teacher available will certainly help, your textbook should have lots of useful information. Don't be afraid to read ahead a bit, or re read sections if you are having trouble understanding a topic. Finally, the sun tutorials are always a great area to look to when you need help.

    The sun tutorials will probably come in handy very often as you progress your understanding of the language. They do a good job of introducing topics and showing some examples to help in understanding the topic.

  5. #5
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    I can give you a sample for your project


    Java Code:
    class student{
    public:
    String First Name ;
    String Last Name ;
    String ID ;
    double TestOne ;
    double TestTwo ;
    double TestThree;
    double TestFour ;
    double TestFive ;
    
    String A1
    String A2
    String A4
    String A4
    String A5
    String A6
    
    };
    
    public yourmainclass{
    public static void main(String a[]){
    
    student b[100]; /*creating instance of class student and let there are 100 students*/
    }
    
    }
    After my post,
    you must learn about OOP before your next post.

    Regard
    Ujjal

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default

    That won't compile.

    It's also not formatted, and does not follow Java naming conventions. (assuming it is supposed to be Java)

  7. #7
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I believe it's meant to be a very rough outline of what is should look like when finished. I thought the same thing about it as well. I could, however; be wrong, it does appear that the op will need to learn a bit to solve this.

  8. #8
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    That won't compile.

    It's also not formatted, and does not follow Java naming conventions. (assuming it is supposed to be Java)
    Check this..
    Java Code:
    String A1
    String A2
    String A4
    String A4
    String A5
    String A6
    No semicolon after statement.How do you expect that it will compile?


    I just gave him a sample, not the code.
    I can give you a sample for your project

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,778
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by UJJAL DHAR View Post
    Check this..
    Java Code:
    String A1
    String A2
    String A4
    String A4
    String A5
    String A6
    No semicolon after statement.How do you expect that it will compile?


    I just gave him a sample, not the code.
    So why did you post it in the first place? You didn't say you were posting in your own private pseudo code and it most certainly is bad Java: it doesn't compile, the formatting is absent and the naming conventions arre terrible. Don't post stuff like that.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    JosAH,
    Some days before someone [new in java] asked in this forum to give him a sample and simple code using for loop.I did for him and One of senior members called me "IDIOT". thats why,


    And a java learner at least learn this before postin in Java-forum.
    Here is the error free code
    Java Code:
    class studetails{
    
    String FirstName ;
    String LastName ;
    String ID ;
    double TestOne ;
    double TestTwo ;
    double TestThree;
    double TestFour ;
    double TestFive ;
    
    String A1;
    String A2;
    String A3;
    String A4;
    String A5;
    String A6;
    
    };
    
    public class student{
    
    public static void main(String a[]){
    
    studetails b[]=new studetails[100];/*creating instance of class student and let there are 100 students*/
     }
    }

  11. #11
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,778
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by UJJAL DHAR View Post
    JosAH,
    Some days before someone [new in java] asked in this forum to give him a sample and simple code using for loop.I did for him and One of senior members called me "IDIOT". thats why,


    And a java learner at least learn this before postin in Java-forum.
    Here is the error free code
    Someone calling you an idiot is no reason to post incorrect, badly formatted code; b.t.w. your naming conventions are still terrible. Read this link.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  12. #12
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    People will only call you an idiot out of annoyance for spoon feeding, if someone does call you an idiot, just shrug it off. Instead of giving them code just force them to solve it themselves. Give them the references, I believe if they are appearing to put an effort into it you can show them useful code snippets, but it's probably better to provide a similar but different type of snippet and they can figure out how to fit it into solving there problem.

    The reason why posting code with bad naming conventions hurts, especially to someone fairly new like the op, is it may lead them to start using bad names. It should be enforced on the people like the op to create meaningful variable names.

  13. #13
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    your naming conventions are still terrible. Read this link.
    JosAH,
    I read it already,I didn't post any of my projects.I have tried to show him that how to create an instance of a class ,nothing else.You should give importance on solving his problem,not in criticism of mine one.

    sunde887,thnks for your suggestion.



    JosAH,
    I am not experienced in Java and Java-forum. In two semester before I have learned java.Now I my University is closed for somedays.So,I am trying to solve others problem with my little knowledge.So, In my post there are lots of problems[in your opinion.].For that I am sorry....

    Regards,
    Ujjal

  14. #14
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,778
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by UJJAL DHAR View Post
    JosAH,
    I read it already,I didn't post any of my projects.I have tried to show him that how to create an instance of a class ,nothing else.You should give importance on solving his problem,not in criticism of mine one.

    JosAH,
    I am not experienced in Java and Java-forum. In two semester before I have learned java.Now I my University is closed for somedays.So,I am trying to solve others problem with my little knowledge.So, In my post there are lots of problems[in your opinion.].For that I am sorry....
    Ujjal,
    there is no need to say sorry for not being very experienced in Java but realize that posting bad code (bad formatting, bad naming conventions, bad method use etc.) is a bad example for those who are less experienced than you are. They would simply copy and paste your stuff and turn it in as is.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  15. #15
    UJJAL DHAR is offline Senior Member
    Join Date
    Apr 2010
    Location
    Dhaka,Bangladesh
    Posts
    180
    Rep Power
    0

    Default

    Well, I will keep it in mind in future.

  16. #16
    doris hiadah is offline Member
    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Default

    i have been doing c and c++ for my programming and I have now started Java. am also having problems and you simply can help me with this question I would be grateful.
    write a java program using grade book class that calculates the GPA of a set of numeric grades by the user. Each user has a maximum of five units and three hours each. (15 credit hours)
    A= 4.0
    B=3.0
    C=2.0
    D=1.0
    F=0
    GPA= total points(grade points* 3 hours)/ hours
    Last edited by doris hiadah; 07-26-2011 at 05:21 PM.

  17. #17
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Quote Originally Posted by doris hiadah View Post
    i have been doing c and c++ for my programming and I have now started Java. am also having problems and you simply can help me with this question I would be grateful.
    write a java program using grade book class that calculates the GPA of a set of numeric grades by the user. Each user has a maximum of five units and three hours each. (15 credit hours)
    A= 4.0
    B=3.0
    C=2.0
    D=1.0
    F=0
    GPA= total points(grade points* 3 hours)/ hours
    Make your own topic with a detailed question and posting any code you might have tried. We are not going to write this program for you. We will only help you learn how to solve it and answer any questions you might have. As long as they aren't "can you give me code that works" questions.
    Tolls likes this.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

Posting Permissions

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