An American, and Australian and an Irishman are sitting on the scaffolding at the top of a new building eating their lunch and the American says 'If I get tuna salad in my sandwich one more time, I'm going to throw myself of this building'. The Australian open his lunch, looks at it and says 'If I get cheese and Vegemite one more time, I'm going to throw myself of this building as well', And young Paddy sitting down the end open his lunch, takes a look and says 'If I get a potato sandwich one more time, I'm going to throw myself off this building too'. So the next day comes around and the lunch whistle blows, so they all sit down to lunch again. The American gets out his lunch and once again, it is tuna salad so he jumps off the building, the Australian gets out his lunch and lo and behold, it's cheese and Vegemite, so he jumps off the building as well, then Paddy opens his lunch and with the potato sandwich still in hand he hurls himself off the building. At the funerals a few days later, the wives are left lamenting the passing of their husbands and the American wife says 'If only I had of known he hated tuna salad so much, I wouldn't have made it every day'. The Australia wife says 'He's been eating cheese and Vegemite since he was kid, ah, if only I had know, I wouldn't have kept making the same sandwiches.' Then the Irish wife pipes up and says 'Oh it's so sad what has happened, but Paddy made his own lunch'.
Write a program to store and examine information about a group of upto 10 people. For each person you must store their name, their nationality (one of Australian, American, or Irishman), and other information depending on their nationality ... for Australians store the number of litres of beer they drink (go metric and learn to spell), for Americans the amount of money they earn, and for Irishmen their favourite letter of the alphabet. Once the information is input from the user, it must be echoed, and then an analysis of possible friendships is made. People could be friends if they have the same name or they have the same nationality. Here what a sample run should look like (with the keyboard input shown in italics) ...
geoff@sherman:Answers> a.out How many people in the group : 4 What is his/her name : Geoff What is his/her nationality : Australian How much beer does (s)he drink : 27 What is his/her name : Trish What is his/her nationality : American How much money does (s)he earn : 57000.02 What is his/her name : Geoff What is his/her nationality : Irishman What is his/her favourite letter : Q What is his/her name : Jeff What is his/her nationality : American How much money does (s)he earn : .03 Geoff is an Australian, and (s)he drinks 27 liters of beer Trish is an American, and (s)he earns $57000.02 Geoff is an Irishman, and (s)he who like the letter 'Q' Jeff is an American, and (s)he earns $0.03 Geoff the Australian and Geoff the Irishman could be friends Trish the American and Jeff the American could be friends