The program when run in xcode should display as shown in the question and it should run properly