Id and Ship
Practice this coding question on Coding Gurukul.
Problem statement
A harbour training simulator stores vessel classes using single-letter identifiers. Operators may type the identifier in uppercase or lowercase, but the display must always show the same canonical class name. You are implementing this lookup so trainees can see a readable vessel type without remembering the letter codes. Every supplied identifier belongs to the supported set. Your task For each input character, ignore its letter case and print the corresponding class: B means BattleShip, C means Cruiser, D means Destroyer, and F means Frigate. Use the exact capitalization of these names in the output. Each identifier is independent of the ones before it. Important details The accepted characters are only B, C, D and F in either case. In particular, BattleShip contains an uppercase S in the middle. Do not print the identifier itself or expand it to an invented vessel name. Worked example For identifiers b, D and f, the output lines are BattleShip, Destroyer and Frigate respectively.
Input format
First line: T. Next T lines: one supported character.
Output format
Print the corresponding vessel class on its own line.
Constraints
1 <= T <= 1000; identifier is one of b,B,c,C,d,D,f,F.
Sample input
3 b D f
Sample output
BattleShip Destroyer Frigate
Sign in to run or submit a solution in C++, Java or Python.