class E07A
def aspiration_type # 吸気系の名称を返すメソッド
return 'Natural Aspiration'
end
def aspiration_power # 吸気系による馬力を返すメソッド
return 5
end
def body_type # エンジン本体の名称を返すメソッド
return '656cc'
end
def body_power # エンジン本体による馬力を返すメソッド
return 50
end
def exhaust_type # 排気系の名称を返すメソッド
return 'normal'
end
def exhaust_power # 排気系による馬力を返すメソッド
return 9
end
def power # 総合の馬力を返すメソッド。各馬力を返すメソッドの合計
return aspiration_power + body_power + exhaust_power
end
def show
printf("吸気系:%s\n",aspiration_type)
printf("本 体 :%s\n",body_type)
printf("排気系:%s\n",exhaust_type)
printf("馬 力 :%d\n",power)
end
end