Baixe o app para aproveitar ainda mais
Prévia do material em texto
Projeto de Software / Programação 3 Exercício: escrevendo um programa em Java Márcio Ribeiro marcio@ic.ufal.br twitter.com/marciomribeiro Exercise 3 Elec*on § Write an elec*on program with the following requirements: § There are two par*es: PSDB (45) and PMDB (15) § Votes for 45 and 15 are considered valid; for other numbers, they are considered null § If the number of null votes is greater than 50% of the valid ones, there is no winner: the elec*on is cancelled § Input: • Number of voters and votes for each party § Output: • If exists, the winner party (and its number); otherwise, inform that the elec>on has been cancelled. Also, print the number of votes of each party and null votes § Discuss with your friends on how to improve each other’s code Notes 5 Notes § Constants § Documenta*on § Java code conven*on § Choose only one language (prefer english)
Compartilhar