Question: write in java correctly will give upvote 3)Calculate age based on Date of Birth Java LocalDate class is an immutable class that represents Date with
write in java correctly will give upvote
3)Calculate age based on Date of Birth
Java LocalDate class is an immutable class that represents Date with a default format of yyyy-mm-dd. It inherits Object class and implements the ChronoLocalDate interface
By utilizing this package we can calculate the age of a person based on the DOB
Reference for this package is available in this link : LocalDate Sample Input : 2000-12-06
Sample Output : 22
4) armstrong number
It is also known as pluperfect, or Plus Perfect, or Narcissistic number.
It is an OEIS sequence A005188.
1: 11 = 1
2: 21 = 2
3: 31 = 3
153: 1^3 + 5^3 + 3^3 = 1 + 125+ 27 = 153
125: 1^3 + 2^3 + 5^3 = 1 + 8 + 125 = 134 (Not an Armstrong Number)
1634: 1^4 + 6^4 + 3^4 + 4^4 = 1 + 1296 + 81 + 256 = 1643
There are no 2-digit Armstrong numbers.
Sample input: 153
Sample output: Armstrong Number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
