Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FilterSystem

A simple yet powerful console-based toolkit for filtering and grouping people data based on age, sex, and nationality.

🚀 Features

🍺 Alcohol Filters

  • Filter people who can drink alcohol in Germany (age 16+)
  • Filter people who can drink alcohol in USA (age 21+)
  • Filter people who can drink alcohol in Afghanistan (age 14+, male only)
  • Each filter returns a new array with only the matching people

🗣️ Language Filter

  • Filter people who can freely speak English
  • Includes citizens of USA and Canada

📦 Grouping with HashMap

  • Group by passport strength — Afghanistan goes under WEAK, USA, Canada and Germany go under STRONG
  • Group by sex — splits people into MALE and FEMALE lists
  • Group by age — calculates average age and splits into YOUNG (below average) and OLD (above average)
  • Count English speakers — returns a map with true (USA & Canada, age 4+) and false (everyone else)

🖨️ Print Utilities

  • Print any people dataset directly to the console
  • Universal printMap() method works with any grouped result

🧠 Concepts Covered

  • Enums for type-safe data (Sex, Nationality, PassportStrength, Adulthood)
  • Arrays vs ArrayList — when and why to use each
  • HashMap as a key-value data structure for grouping
  • DRY principle — reusable methods instead of repeated code
  • Single Responsibility — each class has one clear purpose
  • Autoboxing — difference between int and Integer, boolean and Boolean

▶️ How to Run

  1. Clone the repository
  2. Open in IntelliJ IDEA
  3. Run Main.java

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages