xxxxxxxxxx
//Write a program that determines the class of the ship depending on its class ID (identifier).
//Here are the criteria: The class ID serves as the input data and the ship class as the output information.
//Class ID: B, C, D, F. Ship Class: Battleship, Cruiser, Destroyer, Frigate.
#include<stdio.h>
main()
{
char cid;
printf("INPUTTED ANSWER MUST BE ALPHABETICAL LETTER");
printf("\nEnter the class ID of the ship: ");
scanf("%c",&cid);
switch(cid)
{
case'b':case'B':
printf("\nSC: BATTLESHIP\n"); break;
case'c':case'C':
printf("\nSC: CRUISER\n"); break;
case'd':case'D':
printf("\nSC: DESTROYER\n"); break;
case'f':case'F':
printf("\nSC: FRIGATE\n"); break;
default:
printf("\nUNKNOWN SHIP CLASS!\n"); break;
}
}