public class EmployeeTest {
public static void main(String[] args) {
// TODO 投票功能
Scanner sc = new Scanner(System.in);
int choice;
int count1 = 0,count2 = 0,count3 = 0;
for (int i = 0; i < 5; i++) {
System.out.println("***********************************");
System.out.println("************欢迎使用投票系统********");
System.out.println("***********************************");
System.out.println("参加评选的员工有:");
String[] names={"1:王小毛","2:周新雨","3:张烨"};
for (String string : names) {
System.out.println(string+" ");
}
System.out.print("请投票:");
choice = sc.nextInt();
switch (choice) {
case 1:
count1++;
break;
case 2:
count2++;
break;
case 3:
count3++;
break;
}
System.out.println("----已有"+(i+1)+"人投票,剩余"+(5-i-1)+"票");
}
System.out.println("投票结束");
System.out.println("王小毛的票数是:"+count1);
System.out.println("周新雨的票数是:"+count2);
System.out.println("张烨的票数是:"+count3);
}
}