EDIT: sorry, i also have to print a bar graph for grade, so if there are 4 A grades, it should output A: 4 ####
the only way i could think to do this was use this, but it doesn't work:
view plaincopy to clipboardprint?
1. String pound = " #";
3. String star = (String.valueOf(numA));
4. star = star.replace(star, pound);
6. System.out.println("A: " + numA + star);
String pound = " #"; String star = (String.valueOf(numA)); star = star.replace(star, pound); System.out.println("A: " + numA + star);
it replaces star with a single pound sign even though star should be the value of A. maybe.
it works! the second part of my problem was the sentinel value. it counts -999 as a grade, so it tells me there are 10 F grades even though there are only 9. i have it written this way because the TA of my class walked us through that part. does the mean she missed something, or did i? it's happening because Java works through the first bad value and then stops, right? but i don't want it to count the sentinel, just acknowledge that it exists and terminate.