vendredi 10 mars 2017

Computing Letter Grade and Adding it to a One-Dim arrary

In this section of programing I am trying to assign a letter grade to a numerical grade. I have done this before using if statements but this time I am trying to assign it into an array sequence. The array is of type char. scores[] contains the number grade.Im not sure of how to assign letters to an array. Im sure its a simple fix that I am just not thinking of. If you have any help it would be appreciated. Thanks

(score[i] has been determined in another method, and I know it works because it prints them in my output statement and i my computing average method, just didnt want to copy the entire code)

public void computeGrades (){
         if (scores[i] >= 90){
            grades[] = 'A';
         }
         else if (scores[i] >= 80){

         }
          else if (scores[i] >= 80){

         }
          else if (scores[i] >= 70){

         }
          else if (scores[i] <= 60){

         }

   }

Aucun commentaire:

Enregistrer un commentaire