We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
・アプリ名(ディレクトリ名)はcamp_weekday_task2です。 ・camp_weekday_task2の直下に配置しているcar.rbまたはanimal.rbを使用し、実装して下さい。 ・以下の設問順に実装して下さい。
camp_weekday_task2
car.rb
animal.r
平日課題2: Rubyに関する課題
Carクラスのspeed_upメソッドの修正(課題2-1)
・@speedが30以上になった時にアラートを表示。 ・@speedが50以上になった時にアラートを表示した後、speed_downメソッドを実行。
@speed
speed_down
Carクラスを継承したTrackCarクラスの作成(課題2-2)
・attr_reader :load_weightを追加。 ・引数がnumber、color、load_weightであるinitializeメソッドを追加。load_weightはデフォルトで500を設定。
attr_reader :load_weight
number、color、load_weight
initialize
load_weight
Carクラスでget_onメソッドの追加(課題2-3)
・attr_accessor :passengersを追加。 ・定数MAX_PASSENGERSを追加。 ・initializeメソッドに@passengersの初期値を追加。 ・get_onメソッドの定義。
attr_accessor :passengers
MAX_PASSENGERS
@passengers
get_on
Carクラスにクラスメソッドcount_infoを追加(課題2-4)
Animalクラスを継承したDogクラス、Catクラスを作成(課題2-5)
・Dogクラス、Catクラスでそれぞれ@voiceに文字列を代入し、各インスタンスで違った鳴き声を出力。
@voice
close #1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
課題詳細
・アプリ名(ディレクトリ名)は
camp_weekday_task2
です。・
camp_weekday_task2
の直下に配置しているcar.rb
またはanimal.r
bを使用し、実装して下さい。・以下の設問順に実装して下さい。
課題リンク
平日課題2: Rubyに関する課題
受け入れ基準
・
@speed
が30以上になった時にアラートを表示。・
@speed
が50以上になった時にアラートを表示した後、speed_down
メソッドを実行。・
attr_reader :load_weight
を追加。・引数が
number、color、load_weight
であるinitialize
メソッドを追加。load_weight
はデフォルトで500を設定。・
attr_accessor :passengers
を追加。・定数
MAX_PASSENGERS
を追加。・initializeメソッドに
@passengers
の初期値を追加。・
get_on
メソッドの定義。・Dogクラス、Catクラスでそれぞれ
@voice
に文字列を代入し、各インスタンスで違った鳴き声を出力。close #1
The text was updated successfully, but these errors were encountered: