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.
Type: Posts; User: vanDarg
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.
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.
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...
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...
You could use another multi-dimensional array here, but it seems unnecessary.
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 =...
import javax.swing.JOptionPane;
public class Pract {
public static void main(String[] args) {
char[][] answers = {
{'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A',...
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
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...
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...
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...
Here is your original code, with some notes:
import javax.swing.JOptionPane;
public class GradeExam {
public static void main(String[] args) {
char[][] answers = {
...
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...