Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
/* Use the unit tests provided in test_age.cpp to figure out
the full requirements for this function and then modify
this function so that it passes all of the tests */
#include <string>
/**
* Return a string containing an age descriptor for a supplied age
*
* @param age the age of a person
* @return an age descriptor
*/
std::string age_description( int age )
{
if( age < 5 )
{
return "baby";
}
if( age > 13 && age <= 19 )
{
return "teenager";
}
if( age > 65 )
{
return "OAP";
}
return "adult";
}