Percentage in Java
I'm using BlueJ
I need help in how to calculate and display the percentage of votes that each candidate received?
public String result()
String electionResults = "Election Results: \n";
for (int i = 0; i < this.names.length; i++)
electionResults += ("\n\t" + names[i] + "--" + votes[i]);
Re: Percentage in Java
Please use [code] tags [/code] when posting code.
What do you see happening with your code and what should you see?
If you get errors or exceptions then please post them in full (including stack trace) highlighting the code on which they occur.