Write a program to determine the class type of a War Ship. Given the following
scale:
Class_ID
Class_type
B or b
Battleship
Cor c
Cruiser
D or d
Destroyer
For f
Trigate
Other values of Class_ID will displayed output "Not a War Ship".
Input the Class_ID and display its Class_Type
Start
Declare variable Class_ID
Read Class_ID
if Class_ID='B' or Class_ID='b' then
Display "The class type of a War Ship is Battleship"
else if Class_ID='C' or Class_ID='c' then
Display "The class type of a War Ship is Cruiser"
else if Class_ID='D' or Class_ID='d' then
Display "The class type of a War Ship is Destroyer"
else if Class_ID='F' or Class_ID='f' then
Display "The class type of a War Ship is Trigate"
else
Display "Not a War Ship"
End if
Stop
Comments
Leave a comment