newbie here.
This is the code
for (i = 0; i < 5; i++) {
System.out.println("Enter Name of the event " + (i + 1) + " that the teams are entering");
Tevent[i] = scan.next();
} // event names
for (int a = 0; a < 1; a++) {
System.out.println("Enter rank of the team on the event"); // event ranks
teamRank[i] = scan.nextInt();
if (teamRank[i] > 3) {
System.out.println("This team will not be awarded points");
}
if (teamRank[i] == 3) {
System.out.println("5 points is granted for this event");
teamScore[i] = teamScore[i] + 5;
}
if (teamRank[i] == 2) {
System.out.println("10 points is granted for this event");
teamScore[i] = teamScore[i] + 10;
}
if (teamRank[i] == 1) {
System.out.println("20 points is granted for this event");
teamScore[i] = teamScore[i] + 20;
}
The code is supposed to ask for event name and then ask for the rank.
According to the rank, it is supposed to add points to the team on each event and then print out the summarized value.
Example:
- if I enter rank 1 5 times, instead of showing 100 it shows 20
I tried using multiple loops, it didn't work.
I feel like I am totally wrong on the code. Maybe there's another way of doing this? Can someone show me the way please :D thanks