Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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 (ie, don't compute the result as 2021 - birthYear - 1 + birthdays). You do not need to test if birthdays is 0 or 1, or if the address is less than 20000000, or if the birth year will produce an age less than 1 or greater than 99. Computes the age (in years) of a person using the following convoluted algorithm: 4
    *
  • 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

Students also viewed these Databases questions

Question

Developing and delivering learning that is integrated with the job.

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago