The name of your C program file must be called tank1.c, files with any other name will not be marked.
Each tank has a unique tank number and is named Tank 1 to Tank 20. Furthermore, each tank belongs to one of twenty teams which are named Team 1 to Team 20.
When a tank x kills another tank y (where x and y are the tank numbers), there are three possible scenarios:
Write a program that asks the user to input the tank and team numbers for two tanks: the shooting tank and the tank being hit, and print out the correct scenario above.
$ gcc -Wall tank1.c -o tank1 $ ./tank1 Enter tank number of shooter (1-20): 5 Enter team number of shooter (1-20): 6 Enter tank number of tank being hit (1-20): 7 Enter team number of tank being hit (1-20): 8 Tank 5 from team 6 shot enemy tank 7 on team 8. Well done! $ ./tank1 Enter tank number of shooter (1-20): 5 Enter team number of shooter (1-20): 6 Enter tank number of tank being hit (1-20): 7 Enter team number of tank being hit (1-20): 6 Tank 5 from team 6 shot teammate tank 7. Oops. $ ./tank1 Enter tank number of shooter (1-20): 5 Enter team number of shooter (1-20): 6 Enter tank number of tank being hit (1-20): 5 Enter team number of tank being hit (1-20): 6 Tank 5 shot itself. Major oops. $
A total of 8 different hosts have accessed this document in the last 445 days; your host, nsrp-source.comp.nus.edu.sg, has accessed it 5 times.
If you're interested, complete statistics for this document are also available, including breakdowns by top-level domain, host name, and date.