I'm a novice in Java. I'm doing a project for my high school class. So far my program has been working well however I'm trying to print a line if a statement is true, it's not working though here's is what I'm talking about:
System.out.println ("THANK YOU FOR VOTING IN TONIGHTS ELECTION,/n CONGRATS TO TONIGHTS WINNER:...");
}
if (totalLib > totalPC && totalLib > totalNDP){
System.out.println ("Liberals won, Goodnight Ontario!");
}
else if (totalNDP > totalPC && totalNDP > totalLib){
System.out.println ("NDP won, Goodnight Ontario!");
}
else if (totalPC > totalLib && totalPC > totalNDP){
System.out.println ("CONSERVATIVEs won, Goodnight Ontario!");
}
Aucun commentaire:
Enregistrer un commentaire