Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public classA {
- int[] idades;
- public int someTudo(String nome) {
- int soma = 0;
- for(int i = 0; i < 10; i ++) {
- if ( verificaIdade(i) ) {
- soma += idades[i];
- }
- }
- return soma;
- }
- private boolean verificaIdade(int id) {
- if (idades[id] > 18) {
- return true;
- } else {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement