0
I wanted to know how to make an algorithm in which I inserted a year, and the value increased with age, as year 2016=1, year 2017 = 2, in a method.
Something like that:
int fazAniversidade(int ano) {
if(ano == 2015) {
this.idade +=1;
}
if(ano == 2016) {
this.idade +=2;
}
return 0;
}
But in a loop, how to do?
What rule will you use to increase the year? Will you read the time in the system or is it just a test?
– Felipe Siedschlag Yopán
I think you could put more details, try to clarify your doubt.
– Delfino