I have this coursework assignment and im supposed to create a class with a constructor with a single parameter, an array of integers specifying incomes, in increasing order. Later i have to draw a chart that shows the incomes and the taxes. I wrote a bit of code with the help of a demonstrator during a practical,but right now im stuck again
public class TaxChart {
static int[] income;
public TaxChart(int[] income) {
this.income = income;
income[0] = 100;
income[1] = 120;
income[2] = 130;
income[3] = 160;
income[4] = 320;
}
public static void main(String[] args) {
draw();
}
public static void draw() {
TaxChart incomes = new TaxChart();
// ...
}
}
Somehow I need to get the income values to the draw method,but i get loads of errors when doing it this way. I know this is a simple question,but I mainly programmed in C++ before and I have almost zero experience in Java.