Final answer:
This program is designed to input a phone number and output a phone directory with international numbers, incrementally completing each step with different modifications.
Step-by-step explanation:
This program is designed to take input of a phone number and output a phone directory with international numbers. Each phone number is divided into four parts: country code, area code, prefix, and line number. The program completes each step incrementally, starting with the United States phone number and adding additional countries and modifications in each step.
In Step 1, the program reads the area code, prefix, and line number from the input. It then outputs the directory heading and the United States phone number using the proper formatting.
In Step 2, the program outputs a phone number for Brazil with the country code +55 and adds 100 to the prefix.
In Step 3, the program outputs phone numbers for Croatia with the country code +385 and adds 50 to the line number, and for Egypt with the country code +20 and adds 30 to the area code.
In Step 4, the program outputs a phone number for France with the country code +33 and swaps the area code with the prefix.