OK...
thanks for stopping to read
this code is starting to annoy the crap out of me aha
my issue is that the i in the for loop wont count up
any one know why? please help
**BTW i am a beginerish programmer**
its this for loop:
for (int i = 0; i < max; i=i+1) { //m =store[i]; while (j<10){ g2.drawRect((i*SIZE), (LINE-((j+1)*SIZE)), SIZE, SIZE); j++; g2.drawString("Number of students = " + i , 20, 20); } }
this is the rest of the code for this class:
import java.awt.*; import javax.swing.*; public class BellCurve extends JComponent { public static final int SIZE = 10; public static final int LINE = SIZE*(62-10); private String [] values; Score s; public int students; public int k = 0; private int f = 0; private int j = 0; private int l; private int m; private int max; private int [] scores; private int [] store; public BellCurve(String [] values) { this.values = values; s = new Score(values); max = Integer.parseInt(values[2]); store = new int[max]; } public BellCurve() { this.values = new String [5]; s = new Score(values); max = 100; store = new int[max]; } public void paintComponent(Graphics g) { i = 0; j = 0; Graphics2D g2 = (Graphics2D) g.create(); //students = s.getStudents(); //scores = s.getScore(); g2.drawLine(0, LINE, 1020, LINE); g2.drawString("Range of marks = " + s.getRMin() + " - " + s.getRMax(), 20, LINE+35); g2.drawString("Mean and Standard Deviation = " + s.getMu() + ", " + s.getSigma(), 20, LINE+50); if (k<students){ g2.drawString("Number of students = " + k, 20, LINE+20); //l=scores[k]; // store[l]++; for (int i = 0; i < max; i=i+1) { //m =store[i]; while (j<10){ g2.drawRect((i*SIZE), (LINE-((j+1)*SIZE)), SIZE, SIZE); j++; g2.drawString("Number of students = " + i , 20, 20); } } k+=1; }else{ } } }