Search:

Type: Posts; User: vanDarg

Search: Search took 0.12 seconds.

  1. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    Thanks for your confidence, I'd follow that link I provided on sorting multi-dimensional arrays, this should get your code to where you need it.
  2. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    I was referring to your most recent post. You don't have to move the sorting into a method, it was just a suggestion. Work on the sorting.
  3. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    Looking good, I did not realize that you had to sort the grades in such a way. So, using a multi-dimensional array here is a good idea. I think you need to look a little closer at the sorting...
  4. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    For the if statements, look at the brackets in which the for loop is running.
    As for the students grades, are you saying that each student has a unique grade? Ex. Student 1 has 6, and student 2 has...
  5. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    You could use another multi-dimensional array here, but it seems unnecessary.
  6. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    Good work.
    First, you CAN associate a student with the score, since the array at position 0 would represent student 1, and position 1 would represent student 2, and so on:


    String result3 =...
  7. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    import javax.swing.JOptionPane;
    public class Pract {
    public static void main(String[] args) {
    char[][] answers = {
    {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A',...
  8. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    It is the correct way, which is why I suspect that this line may be out of place, or that you are not accessing the correct array. Post your final code again, please
  9. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    Oh don't worry about it, no big deal :) I just wanted to let you know.
    And yes, all zeros would mean that you don't have to sort it. But we are obviously getting that in error. Thoroughly check...
  10. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    A quick word of advice, when writing code, there are many things that factor into the readability of your code. This includes but is not limited to: line indentation, the use of open space, the use...
  11. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    To enter the correctCount into the array:


    sort[i] = correctCount


    With this code, if 'i' was 2 and correctCount was 7, then student number 3 (remember, start at 0) would have 7 correct...
  12. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    Here is your original code, with some notes:


    import javax.swing.JOptionPane;
    public class GradeExam {
    public static void main(String[] args) {
    char[][] answers = {
    ...
  13. Replies
    37
    Views
    8,372

    Re: Two-Dimensional Array to Grade Students?

    For sorting, I would create a third array, of ints. This array would be the size of the number of students (with index 0 being the first student, index 1 being the second, and so on). After each...
Results 1 to 13 of 13