How to resolve the algorithm Cheryl's birthday step by step in the Phix programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Cheryl's birthday step by step in the Phix programming language

Table of Contents

Problem Statement

Albert and Bernard just became friends with Cheryl, and they want to know when her birthday is. Cheryl gave them a list of ten possible dates: Cheryl then tells Albert the   month   of birth,   and Bernard the   day   (of the month)   of birth.

Write a computer program to deduce, by successive elimination, Cheryl's birthday.

Let's start with the solution: