By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

storing student grades in a two-dimensional array in a class grade book

P: 3
I am struggling to figure out how to create a java program that can store student grades in a two dimensional array in a class grade book. If anyone could provide some help i would greatly appreciate it.
Dec 5 '12 #1
Share this Question
Share on Google+
5 Replies


zmbd
Expert Mod 5K+
P: 5,397
Sounds like a homework question?
If not then one of the many tutorials via google will help you such as http://www.freejavaguide.com/corejava.htm
Dec 5 '12 #2

P: 3
i understand the whole array aspect but dont know how to store them as a grade book
Dec 5 '12 #3

zmbd
Expert Mod 5K+
P: 5,397
Respectfully, if you understood how arrays worked and the methods for using them then you would have no need to ask the question as this is a fundamental usage for arrays.

The tutorial I linked you to has a very nice example and explanation of the array structure and methods for implementation.

Please show your work to this point.
Remember to format posted programs/html/sql using the <CODE/> button in the toolbar.
Dec 5 '12 #4

P: 3
but im trying to make a grade book so can i make the first column the names of the student and then the second column their grades?
Dec 5 '12 #5

zmbd
Expert Mod 5K+
P: 5,397
Declaring Arrays

Like other variables in Java, an array must have a specific type like byte, int, String or double. Only variables of the appropriate type can be stored in an array. You cannot have an array that will store both ints and Strings, for instance.
So, if this is true then how would one go about defining a data-type that would allow one to use use a string and an integer primal types?

Once you have the user defined data type figured out, then you will understand that you would need only a single dimensional array to store the name/grade elements.
Dec 5 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.