Answer to Question #263439 in Algorithms for lhanz

Question #263439

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

1
Expert's answer
2021-11-09T10:20:00-0500


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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS