divider

Objective

Build a console program that asks the user for their head circumference (in inches) and displays a matching hat size label.

Skills to Practice

  • icon Evaluating Boolean expressions
  • icon Branching with Selection Statements
divider

Tasks

  • icon Create a new project named sprint-2-3
  • icon Complete the following tasks:
    • icon Ask the user to enter their head size in inches
    • icon Use selection statements to math the input to a hat size category
    • icon Display the had size and a custom message based on the range

Hat Size Reference

Circumference Hat Size Message
20-21 Small Snug fit for speedy thinkers
21-22.5 Medium Balanced and brilliant
22.5-24 Large Roomy for big ideas
24+ Extra Large Legendary noggin detected
divider

Sample Output

Sample Output
Enter your head size in inches: 23
Hat size: Large
Roomy for big ideas.

Begin Challenge