-2

I am totally new in Java 2D Array. And I am trying to do a project to a) ask for student number b) ask for their name c) ask for their exam marks d) display all of the results.

Thanks and Truly appreciated if anyone is kind enough to provide me a solution.

Thanks.

  • what has been you impl so far – jaipster Apr 22 '14 at 10:42
  • Show your effort, please. – Denis Kulagin Apr 22 '14 at 10:47
  • 1
    This really sounds like "do my assignment please". Please reformulate your question if it is about the choice of a 2D array. – Joffrey Apr 22 '14 at 10:48
  • Some links to read first. http://stackoverflow.com/questions/17691162/how-to-read-strings-from-scanner-in-console-application-java http://stackoverflow.com/questions/18888476/how-to-store-input-values-in-an-array-by-using-scanner-in-java http://stackoverflow.com/questions/8771306/printing-java-arraylist-contents-line-by-line-to-console – Denis Kulagin Apr 22 '14 at 10:50
  • Hi all, thanks for the comments. This is not for my assignment but instead I am just interested to learn java by myself. I have just learned about 2-D array on how to declare and initialize like int[][]=new int[3][4] Then the exercise at the back has advanced so much on the question asking me to add a user input. It is an online exercise provides me with no solution. It is okay if it is quite troublesome for you guys to provide the solution to me. Just trying my luck. will search through more online exercise with solution. Thanks. – user3560020 Apr 22 '14 at 11:03

1 Answers1

2

I won't directly give you code because we are not here to do your assignment. However, I can give hints.

The choice of a 2D array might not be the right option for you, because I suspect you're gonna use it this way: 1 dimension indexing the students, the 2nd dimension indexing properties of a student.

A more Java-like approach (or OOP approach) would be to create objects representing students, and read a 1D array of Student objects instead.

Joffrey
  • 32,348
  • 6
  • 68
  • 100