合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

        COMP9021代做、代寫python設(shè)計程序

        時間:2024-07-20  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



        COMP**21 Principles of Programming 
        Term 2, 2024 
        Coding Quiz 5 
        Worth 4 marks and due Week 8 Thursday @ 9pm 
         
        Description 
        You are provided with a stub in which you need to insert your code where indicated without doing any 
        changes to the existing code to complete the task. Although it is not needed for this quiz, you may import 
        any extra module that is already installed in Ed if you wish. 
        The program randomly generates a grid with 0s and 1s, whose dimension is controlled by user input, as 
        well as the density of 1s in the grid, and finds out for a given step_number ≥ 1 and a given step_size ≥ 2, 
        the number of stairs of step_number many steps, with all steps of size step_size. 
        A stair of 1 step of size 2 is of the form: 
        1 1 
         1 1 
        A stair of 2 steps of size 2 is of the form 
        1 1 
         1 1 
         1 1 
        A stair of 1 step of size 3 is of the form 
        1 1 1 
         1 
         1 1 1 
        A stair of 2 steps of size 3 is of the form 
        1 1 1 
         1 
         1 1 1 
         1 
         1 1 1 
         2 
         
         
        The output lists the number of stairs from smallest step sizes to largest step sizes, and for a given step size, 
        from stairs with the smallest number of steps to stairs with the largest number of stairs. 
        Your task is to implement the function called stairs_in_grid(). 
        You may possibly define other functions. 
        The provided stub and the outputs of the sample test cases explain the task to be performed. 
         
        Marking 
         stairs_in_grid() 4 marks 
         ------------------------------------ 
         Total 4 marks 
         
         
        Due Date and Submission 
        Quiz 5 is due Week 8 Thursday 18 July 2024 @ 9.00pm (Sydney time). 
        Note that late submission with 5% penalty per day is allowed up to 3 days from the due date, that is, any 
        late submission after Week 8 Sunday 21 July 2024 @ 9pm will be discarded. 
        Make sure not to change the filename quiz_5.py while submitting by clicking on [Mark] button in Ed. 
        It is your responsibility to check that your submission did go through properly using Submissions link in Ed 
        otherwise your mark will be zero for Quiz 5. 
         
         3 
         
         
        Test Cases 
         
        $ python quiz_5.py 
        Enter three positive integers: 0 1 2 
        Here is the grid that has been generated: 
         1 1 
         0 1 
         
         
        $ python quiz_5.py 
        Enter three positive integers: 0 1 3 
        Here is the grid that has been generated: 
         1 1 0 
         1 1 1 
         1 1 1 
         
        For steps of size 2, we have: 
         2 stairs with 1 step 
         
         
        $ python quiz_5.py 
        Enter three positive integers: 0 3 9 
        Here is the grid that has been generated: 
         1 1 0 1 1 1 1 1 1 
         1 1 1 1 0 1 1 1 0 
         0 1 1 0 1 1 1 1 1 
         1 1 0 0 0 1 0 1 1 
         1 1 0 1 1 1 1 1 0 
         0 1 1 0 1 1 0 1 1 
         1 1 0 1 1 1 1 1 1 
         1 0 1 1 0 0 1 1 0 
         0 1 1 1 1 1 1 1 1 
         
        For steps of size 2, we have: 
         5 stairs with 1 step 
         1 stair with 2 steps 
         1 stair with 3 steps 
         1 stair with 4 steps 
         
        For steps of size 3, we have: 
         4 stairs with 1 step 
         
         4 
         
         
        $ python quiz_5.py 
        Enter three positive integers: 0 3 7 
        Here is the grid that has been generated: 
         1 1 0 1 1 1 1 
         1 1 1 1 1 1 0 
         1 1 1 0 0 1 1 
         0 1 1 1 1 1 1 
         1 0 0 0 1 0 1 
         1 1 1 0 1 1 1 
         1 1 0 0 1 1 0 
         
        For steps of size 2, we have: 
         2 stairs with 1 step 
         2 stairs with 2 steps 
         
        For steps of size 3, we have: 
         1 stair with 2 steps 
         
         
        $ python quiz_5.py 
        Enter three positive integers: 0 4 8 
        Here is the grid that has been generated: 
         1 1 0 1 1 1 1 1 
         1 1 1 1 1 1 1 1 
         0 1 1 1 1 1 1 0 
         0 1 1 1 0 1 1 1 
         1 1 1 1 1 1 1 0 
         1 0 0 1 0 1 1 1 
         1 1 0 1 1 1 1 1 
         1 1 0 0 1 1 1 0 
         
        For steps of size 2, we have: 
         7 stairs with 1 step 
         3 stairs with 2 steps 
         2 stairs with 3 steps 
         
        For steps of size 3, we have: 
         2 stairs with 1 step 
         1 stair with 2 steps 
         
        For steps of size 4, we have: 
         1 stair with 1 step 
         
         5 
         
         
        $ python quiz_5.py 
        Enter three positive integers: 0 5 9 
        Here is the grid that has been generated: 
         1 1 0 1 1 1 1 1 1 
         1 1 1 1 1 1 1 0 1 
         1 1 1 1 1 1 0 1 0 
         1 1 1 1 0 1 1 1 1 
         1 1 1 1 1 1 1 0 1 
         0 0 1 1 1 1 1 0 1 
         1 1 1 1 1 1 0 1 1 
         1 1 1 1 1 0 0 1 1 
         1 0 1 1 1 1 0 1 1 
         
        For steps of size 2, we have: 
         4 stairs with 1 step 
         5 stairs with 2 steps 
         1 stair with 3 steps 
         2 stairs with 4 steps 
         
        For steps of size 3, we have: 
         9 stairs with 1 step 
         
        For steps of size 4, we have: 
         2 stairs with 1 step 
         
         
         6 
         
         
        Some Test Cases Explained 
         
        $ python quiz_5.py 
        Enter three positive integers: 0 1 3 
        Here is the grid that has been generated: 
         1 1 0 
         1 1 1 
         1 1 1 
         
        For steps of size 2, we have: 
         2 stairs with 1 step 
        $ python quiz_5.py 
        Enter three positive integers: 0 3 9 
        Here is the grid that has been generated: 

         
        請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




         

        掃一掃在手機打開當(dāng)前頁
      1. 上一篇:菲律賓落地簽和旅游簽長什么樣 圖片樣式介紹
      2. 下一篇:COMP9414代做、代寫Python程序設(shè)計
      3. ·COMP9021代做、代寫Python設(shè)計程序
      4. 合肥生活資訊

        合肥圖文信息
        急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
        急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
        出評 開團工具
        出評 開團工具
        挖掘機濾芯提升發(fā)動機性能
        挖掘機濾芯提升發(fā)動機性能
        海信羅馬假日洗衣機亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
        海信羅馬假日洗衣機亮相AWE 復(fù)古美學(xué)與現(xiàn)代
        合肥機場巴士4號線
        合肥機場巴士4號線
        合肥機場巴士3號線
        合肥機場巴士3號線
        合肥機場巴士2號線
        合肥機場巴士2號線
        合肥機場巴士1號線
        合肥機場巴士1號線
      5. 短信驗證碼 酒店vi設(shè)計 NBA直播 幣安下載

        關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

        Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
        ICP備06013414號-3 公安備 42010502001045

        主站蜘蛛池模板: 人妻少妇精品一区二区三区| 在线观看国产一区| 久久久久国产一区二区三区| 日韩在线不卡免费视频一区| 一区二区在线电影| 无码少妇丰满熟妇一区二区| 国产伦精品一区二区免费 | 久久精品无码一区二区三区不卡| 国产AV午夜精品一区二区三区 | 亚洲国产欧美日韩精品一区二区三区| 无码精品人妻一区二区三区免费 | 无码人妻视频一区二区三区| 卡通动漫中文字幕第一区| 一区二区三区视频| 日韩欧国产精品一区综合无码| 亚洲国产精品第一区二区三区| 日韩视频在线一区| 国产亚洲福利一区二区免费看| 91视频一区二区三区| 国产乱码一区二区三区四| 国产91久久精品一区二区 | 欧亚精品一区三区免费| 色窝窝无码一区二区三区色欲| 国产一区麻豆剧传媒果冻精品| 精彩视频一区二区| 一区二区不卡久久精品| 国产福利电影一区二区三区久久久久成人精品综合 | 国产精品一区在线播放| 日韩精品一区二区三区四区 | 国产精品制服丝袜一区| 亚洲一区中文字幕在线电影网| 亚洲一区中文字幕在线电影网| 亚洲一区在线视频| 色婷婷香蕉在线一区二区| 99在线精品一区二区三区| 性色av闺蜜一区二区三区| 免费一区二区三区四区五区| 狠狠爱无码一区二区三区| 日韩精品无码一区二区三区四区| 国产在线精品一区二区夜色 | 久久亚洲日韩精品一区二区三区|