Past Challenge

Last updated on 9 August 2019

For the Novice

Gender Code

👶🏽

Task:

In a certain hospital, all birth certificates are tagged with unique numbers. You have been told that girls receive birth certificates with even numbers and boys receive the ones with odd numbers.

You need to create a program that when given a birth certificate number, it will print either “It’s a Boy” or “It’s a Girl” on the screen depending on whether the number is odd or even respectively.

Note: Python and C++ resources are available to complete this challenge.

Download Resources for:
#Programming LanguageResources
1Python (all beginners)download
2C++ (optional Computer Science)download

For the Experienced

Famous Ward Names

🤔

Task:

Over the June holiday, Luke went to visit his grandparents living at Songambele in Dodoma. When he was few minutes from getting off the bus, he overheard one lady behind him that she was born at Songambele ward in Kagera. Luke wondered how many wards are called Songambele in Tanzania. After searching online, he found out that there are four wards in Tanzania called Songambele: in Kongwa (Dodoma), Urambo (Tabora), Kyerwa (Kagera) and Kiteto (Manyara).

After returning to school, Luke has been searching for ward names that have been reused for more than four times. All he could find are other ward names like Magomeni, Malolo, Mbuyuni and Mjimwema that have also been reused four times. Luke has downloaded a list of all ward names in Tanzania (almost 3,650 wards) and needs your help to find all the ward names that have been reused for more than four times.

Fun Fact: The most famous ward name has been reused fourteen times.

Recommended Tutorials:

C++: C++ STL Map
Java: Java HashMap
Python: Python Dictionary
C++ Advanced Tutorial
Download Resources for:
#Programming LanguageResources
1C++download
2Javadownload
3Pythondownload