Answer to Question #3301 in Java | JSP | JSF for carla

Question #3301
How to calculate the total vote 33,51,43,22,61,51,47 in for loop?
1
Expert's answer
2011-07-05T10:13:33-0400
public class Start {
& public static void main(String[] args)
& {
int[] anArray = {33,51,43,22,61,51,47};
int totalVote = 0;
& for(int i=0; i<anArray.length; i++)
& { totalVote+=anArray[i]; }
System.out.println("Vote= "+totalVote);
& }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS