- Joined
- May 28, 2016
- Posts
- 780
- Solutions
- 1
- Reaction
- 128
- Points
- 308
Good day ka-PHC!, Hingi po sana ako ng tulong kung pano ko maso solve itong pinapagawa samin mga sir.
Ito po yung java code ko po, kaso kapag nagenter na po ako kung ilang entries ang gusto ko, for example 3, nage exceed po sya sa 3, tuloy tuloy na po sya.
Pa help naman po ako mga sir.
Ito po yung java code ko po, kaso kapag nagenter na po ako kung ilang entries ang gusto ko, for example 3, nage exceed po sya sa 3, tuloy tuloy na po sya.
JavaScript:
import java.util.*;
public class Activity_1{
public static void main(String args[]){
Scanner dataIn = new Scanner(System.in);
System.out.print("Enter number of entries: ");
int noOfEntry = Integer.parseInt(dataIn.nextLine());
String lastname[] = new String[noOfEntry];
int votes[] = new int[100];
for (int i = 0; i < lastname.length; i++) {
for (int j = 0; j < votes.length; j++) {
System.out.println("--------------------------");
System.out.print("Enter candidate's name: ");
lastname[i] = dataIn.nextLine();
System.out.print("Enter number of votes received: ");
votes[j] = Integer.parseInt(dataIn.nextLine());
}
}
System.out.println("Candidate\t Votes Received");
for (int i = 0; i < lastname.length; i++) {
System.out.print(lastname[i] + "\n");
}
}
}
Pa help naman po ako mga sir.
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.