Last active
August 29, 2015 14:23
-
-
Save Yama-to/39d5873c2263b5f744e7 to your computer and use it in GitHub Desktop.
【問題編】入門エンジニア技能試験(Ruby/HTML/CSS/Rails) ref: http://qiita.com/Yama-to/items/fc0de97a4914c391ed41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
メンバーの名前を入力してください: | |
TsugumiHoge | |
年齢を入力してください: | |
26 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] : TsugumiHogeの情報 | |
[2] : KoichiTanakaの情報 | |
[3] : ShizukaSakuraの情報 | |
[4] : GeorgeNakamuraの情報 | |
年齢を見たいメンバーの番号を入力してください: | |
1 | |
名前 : TsugumiHoge | |
年齢 : 26 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] : TsugumiHogeの情報 | |
[2] : KoichiTanakaの情報 | |
[3] : ShizukaSakuraの情報 | |
[4] : GeorgeNakamuraの情報 | |
年齢を見たいメンバーの番号を入力してください: | |
1 | |
名前 : TsugumiHoge | |
年齢 : 26 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
メンバーの年齢の範囲を設定してください。 | |
何歳以上のメンバーを見ますか: | |
18 | |
何歳以下のメンバーを見ますか: | |
30 | |
該当するメンバーは以下のとおりです。 | |
名前 : TsugumiHoge | |
年齢 : 26 | |
---------------- | |
名前 : GeorgeNakamura | |
年齢 : 24 | |
---------------- | |
名前 : ShizukaSakura | |
年齢 : 18 | |
---------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plz input start year | |
1800 | |
plz input finish year | |
2015 | |
---------------------- | |
1804,1808,1812,1816,1820,1824,1828,1832,1836,1840,1844,1848,1852,1856,1860,1864,1868,1872,1876,1880,1884,1888,1892,1896,1904,1908,1912,1916,1920,1924,1928,1932,1936,1940,1944,1948,1952,1956,1960,1964,1968,1972,1976,1980,1984,1988,1992,1996,2000,2004,2008,2012 | |
---------------------- | |
there're 52 leap years. | |
---------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
レビュー数:0 | |
[0]メンバーを登録する | |
[1]メンバーの一覧を見る | |
[2]メンバーを年齢別に見る | |
[3]アプリを終了する |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SAY SOMETHING: | |
hi | |
WHAT!? | |
SAY SOMETHING: | |
hello | |
WHAT!? | |
SAY SOMETHING: | |
i said HELLO | |
WHAT!? | |
SAY SOMETHING: | |
HELLO | |
NO! I'M 53 YEAR-OLD! | |
SAY SOMETHING: | |
HUH | |
NO! I'M 50 YEAR-OLD! | |
SAY SOMETHING: | |
OK | |
NO! I'M 59 YEAR-OLD! | |
SAY SOMETHING: | |
BYE | |
NO! I'M 53 YEAR-OLD! | |
SAY SOMETHING: | |
BYE | |
NO! I'M 54 YEAR-OLD! | |
SAY SOMETHING: | |
BYE | |
BYE-BYE, SUNNY! | |
(アプリの終了) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def post_member | |
puts "メンバーの名前を入力してください:" | |
member_name = gets | |
puts "年齢を入力してください:" | |
member_year = gets | |
# 入力された情報を保存する | |
end | |
def index_members | |
# メンバーの名前の一覧を表示する | |
puts "年齢を見たいメンバーの番号を入力してください:" | |
input = gets | |
# 入力された値に対応したメンバーの名前と年齢を表示する | |
end | |
def sort_members | |
puts "メンバーの年齢の範囲を設定してください。\n何歳以上のメンバーを見ますか:" | |
s_input = gets | |
puts "何歳以下のメンバーを見ますか:" | |
f_input = gets | |
# 入力された値に該当する年齢のメンバーだけを抽出し年齢降順に並び替える | |
# 該当するデータが存在しない場合に「該当するデータは存在しません。」と出力 | |
# 該当するデータが存在する場合には「該当するメンバーは以下のとおりです。」と出力し一覧を表示する | |
end | |
def end_program | |
puts "ご利用ありがとうございました。" | |
exit | |
end | |
def exception | |
puts "無効な値です。もう一度入力してください。" | |
end | |
while true do | |
puts "メンター数:0" # 入力した情報の数に応じて変動させる | |
puts "[0]メンバーを登録する" | |
puts "[1]メンバーの一覧を見る" | |
puts "[2]メンバーを年齢別に見る" | |
puts "[3]アプリを終了する" | |
input = gets | |
if input == 0 then | |
post_member | |
elsif input == 1 then | |
index_members | |
elsif input == 2 then | |
sort_members | |
elsif input == 3 then | |
end_program | |
else | |
exception | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment