Hello NQE Enthusiasts,
Several Months ago we posted a challenge to use NQE to solve the FizzBuzz challenge . We had so much fun we thought we would make it a reoccurring exercise to demonstrate the power of NQE and and have some more fun with it.
You might be asking “What are koans”?
"koans" refer to a series of small coding challenges designed to teach programming concepts, often in a particular language.
The term originates from Zen Buddhism, where a "koan" is a paradoxical question or statement used to provoke deep thought and insight.
We are looking forward to see how everyone solves these challenges so tune in and give it a try, there are no wrong answers .
Challenge
Your task is to calculate the age of a list of people not in human years but in “dog years”. Assuming that one human year is equivalent to seven dog years. Calculate for the following input.
Input
people = -
{ Name: "Tom", Age: 25 },
{ Name: "Jerry", Age: 30 },
{ Name: "Spike", Age: 15 }
];
Expected Output:
=
{ Name: "Tom", DogAge: 175 },
{ Name: "Jerry", DogAge: 210 },
{ Name: "Spike", DogAge: 105 }
]
Hints:
I think you can figure it out
Bonus:
For bonus points, use the AVMA’s method of calculating dog-to-human years:
The American Veterinary Medical Association (AVMA) suggests the following guideline: the first year of a medium-sized dog's life is equal to 15 human years, the second year is about 9 human years, and each additional year is about five human years.
Contributions: