{"text_format":"1","workbook":"xlsx","n_sheets":3,"sheets":["問題文＆解答","正答","読み込みシート"],"not_rendered":{"charts":0,"images":1,"macros":1,"external_links":0,"defined_names":0,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"問題文＆解答","index":0,"n_rows":11,"n_cols":4,"rows_kept":11,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
[]
[null,"問題文",null,"解答方法"]
[null,"以下の要件を満たすVBAの\nプログラムを実装して下さい。",null,"解答プログラムは\n「開発」\n→「Visual Basic」\n→「Answer」\n内のSub answer()に記載して下さい。"]
[]
[null,"要件"]
[null,"シート「読み込みシート」の「0.5以下の乱数の発生回数」を読み取り, その値を整数型変数goalCntに代入する。"]
[null,"whileループで0以上1未満の乱数の値がgoalCnt回, 0.5以下になるまでループしつづけて, ループした回数をLong型変数loopCntに格納する。"]
[null,"シート「読み込みシート」をアクティベートにして, 最後にMsgBox関数で「ループ回数:（loopCnt）回」の形式で出力する。"]

{"sheet":"正答","index":1,"n_rows":7,"n_cols":2,"rows_kept":7,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
[]
[null,"正答プログラム例"]
[null,"Option Explicit\n\nSub correctAnswerExample()\n    Dim ws As Worksheet: Set ws = ThisWorkbook.Worksheets(\"読み込みシート\")\n    ' 「0.5以下の乱数の発生回数」を読み込む\n    Dim goalCnt As Integer: goalCnt = ws.Cells(6, 2).Value\n    Dim cnt As Integer: cnt = 0\n    ' ループ回数カウント用変数\n    Dim startTime As Double: startTime = Timer\n    Dim loopCnt As Long\n    Do While cnt <= goalCnt\n        If Rnd <= 0.5 Then\n            cnt = cnt + 1\n        End If\n        loopCnt = loopCnt + 1\n    Loop\n    ' シート「読み込みシート」をアクティベートにする\n    ws.Activate\n    ' ループ回数の表示\n    MsgBox (\"ループ回数:\" & CStr(loopCnt))\nEnd Sub"]
[null,"↑上のプログラムは\n「開発」\n→「Visual Basic」\n→「CorrectAnswerExample」\nに記載してあります。"]

{"sheet":"読み込みシート","index":2,"n_rows":6,"n_cols":2,"rows_kept":6,"cut":false,"hidden":false,"merged":[]}
[]
[]
[]
[]
[null,"0.5以下の乱数の発生回数\n（1以上10以下）"]
[null,5]