Question
complete the methods in java For the method your Age make sure that use the steps in the Javadoc comment to compute the final result
- *
- start with the person's street (@code address) *
- double the result from the previous step *
- add 42 to the result from the previous step
- multiply the previous step by 50
- subtract the person's {@code birthYear} from the previous step
- subtract 50 from the previous step *
- add the number of {@code birthdays} the person has had this year to the previous step
- subtract 30 from the previous step
- removes all but the last two digits of the result from the previous step; the last two digits are equal to the age of the person
This algorithm works only for people aged 1-99 and for addresses less than approximately @param address the person's street address number @param birthYear the person's birth year @param birthdays the number of birthdays the person has had this year (either @ or 1) return the age of the person public static int yourAge(int address, int birthYear, int birthdays) { int result = address; W/ -make sure that you follow the rest of the steps described VL in the doc comment above to compute the final result 1 each step should be one additional line of code (so don't merge multiple steps together) y this means that the next line of code should be something like: result = result. 2; // return result; 3 /**
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started