Write a code segment that will analyze a numeric value


Write a code segment that will analyze a numeric value provided by the user to determine if he or she is a newborn, a child, a teenager, or an adult. Make sure to include the following in your code:

  • Display the message "Please enter your age in years" to the user.
  • Use the ReadLine() method to obtain a value from the user.
  • Use the Parse() method to convert the user's value to an appropriate data type for numeric comparisons.
  • Check to be sure the user entered a value greater than or equal to 0 and less than or equal to 150.
  • Use ElseIf statements to determine the stage of life associated with the user's input.An input value of 0 indicates the user is a newborn.An input value of 1 up to but not including 13 is a child.An input value of 13 up to but not including 20 is a teenager. An input value of 20.0 or more is an adult.

Solution Preview :

Prepared by a verified Expert
Business Management: Write a code segment that will analyze a numeric value
Reference No:- TGS01732732

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)