Results 1 to 17 of 17
Thread: need a lot of java help!!!
- 03-26-2011, 08:43 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 17
- Rep Power
- 0
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.
-
This is best answered at the Java tutorials which you can find here:
Java Tutorials Really Big Index
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.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.
Your best bet is to study, study, and do more study. Best of luck.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.
- 03-27-2011, 06:10 AM #3
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
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.
- 03-27-2011, 06:29 AM #4
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
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.
- 03-27-2011, 06:54 AM #5
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
I can give you a sample for your project
After my post,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*/ } }
you must learn about OOP before your next post.
Regard
Ujjal
- 03-27-2011, 07:26 AM #6
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
That won't compile.
It's also not formatted, and does not follow Java naming conventions. (assuming it is supposed to be Java)
- 03-27-2011, 07:30 AM #7
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
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.
- 03-27-2011, 07:44 AM #8
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
Check this..That won't compile.
It's also not formatted, and does not follow Java naming conventions. (assuming it is supposed to be Java)
No semicolon after statement.How do you expect that it will compile?Java Code:String A1 String A2 String A4 String A4 String A5 String A6
I just gave him a sample, not the code.
I can give you a sample for your project
- 03-27-2011, 07:58 AM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,423
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-27-2011, 08:29 AM #10
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
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*/ } }
- 03-27-2011, 08:37 AM #11
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,423
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-27-2011, 09:06 AM #12
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
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.
- 03-27-2011, 09:45 AM #13
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
JosAH,your naming conventions are still terrible. Read this link.
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
- 03-27-2011, 10:00 AM #14
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,423
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-27-2011, 10:14 AM #15
Senior Member
- Join Date
- Apr 2010
- Location
- Dhaka,Bangladesh
- Posts
- 178
- Rep Power
- 0
Well, I will keep it in mind in future.
- 07-26-2011, 04:16 PM #16
Member
- Join Date
- Jul 2011
- Posts
- 1
- Rep Power
- 0
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)/ hoursLast edited by doris hiadah; 07-26-2011 at 04:21 PM.
- 07-26-2011, 04:31 PM #17
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.
- 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.


1Likes
LinkBack URL
About LinkBacks


Bookmarks