in Technology

Growing Baby

It’s Logic Builder time again! Here’s a simple one!

Kids grow very fast! This time, you have to write a small application that will show you the height growth of a kid. The input parameters will be:

  • Birth Date
  • Height on birth
  • Growth in inches every week

The output should be the dates on which the growth from last date touches one inch. The output should stop at 6 feet height.

Suppose, the baby was born 1st January 2005. The height on birth was 20 inches and the baby grows one inch every week. Then the output would go something like:

2005-01-01 20
2005-01-08 21
2005-01-15 22
2005-01-22 23
2005-01-29 24
2005-02-05 25
2005-02-12 26
2005-02-19 27
2005-02-26 28
2005-03-05 29
2005-03-12 30

…. and so on till 72 inches.

Simple? Go ahead and try it out!

Write a Comment

Comment