Attempt a character sketch of the Glow-worm. (40 words)
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class KboatPolling
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter the number of voters: ");
long totalVoters = in.nextLong();
long votedVoters = Math.round(0.8 * totalVoters);
long xVotes = Math.round(0.6 * votedVoters);
long yVotes = votedVoters - xVotes;
System.out.println("Total Votes: " + votedVoters);
System.out.println("Votes of X: " + xVotes);
System.out.println("Votes of Y: " + yVotes);
}
}
Similar questions