I am making an expense tracker program for an assessment project, but the thing is, the question sheet is too vague. One of the problems is that, I am not sure if I should just stick to a one-dimensional array or a multi-dimensional one.
The whole idea is that; a user selects a month and it will prompt an option that allows user to assign the expense to that month and to a certain item. It would look some thing like this:
Enter month (1 for Jan - 12 for Dec): 1
Jan expenditure(max 10 items) Enter item 1 (Press ENTER to exit): fast food
Enter amount : $10
What kind of dimensional array should I used? It seems that as I progress into the different dimension of arrays, it kinda like open up a can of worms.
So far, I have gotten this:
int m = 12;
int exp = 10;
int[][] month = new int [m][exp];
public void data(){
}
public void monthlyExp(){
String[] mth = {"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep",
"Oct","Nov","Dec"
};
System.out.print("Enter month > ");
int mon = input.nextInt();
for (int i = 0; i < month.length; i++){
System.out.println();
if (i == (mon-1)){
System.out.println(mth[i] + " expenditure <max 10 items>");
while (true){
for (int h = 0; h < exp; h++);
System.out.print("Enter item " + (h + 1) + "(PRESS ENTER TO EXIT)");
}