代做COMP9021、代写python语言编程

时间:2024-06-15  来源:  作者: 我要纠错



COMP9021 Principles of Programming
Term 2, 2024
Coding Quiz 1
Worth 4 marks and due Week 3 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. You may import any module that is already installed in
Ed if you wish.
The current code generates a random list of integers between 1 and 6 whose length is chosen by the user
and displays the list.
Your task is to output the absolute difference between the first and the last values, displays the values as
horizontal bars of dollars ($), and displays the values as vertical bars of stars (*).

Marking
Absolute Difference 1.0 mark
Horizontal Bars 1.5 marks
Vertical Bars 1.5 marks
--------------------------------------------
Total 4.0 marks

Due Date and Submission
Quiz 1 is due Week 3 Thursday 13 June 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 3 Sunday 16 June 2024 @ 9pm will be discarded.
Make sure not to change the filename quiz_1.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 1.

Test Cases

$ python quiz_1.py

Enter two integers, the second one being strictly positive: 3 1
Here are the generated values: [2]

The absolute difference between first and last values is:
0

Here are the values represented as horizontal bars:

$ $

Here are the values represented as vertical bars:
$ python quiz_1.py

Enter two integers, the second one being strictly positive: 0 2
Here are the generated values: [4, 4]

The absolute difference between first and last values is:
0

Here are the values represented as horizontal bars:

Here are the values represented as vertical bars:

$ python quiz_1.py

Enter two integers, the second one being strictly positive: 0 4
Here are the generated values: [4, 4, 1, 3]

The absolute difference between first and last values is:
1

Here are the values represented as horizontal bars:

Here are the values represented as vertical bars:
$ python quiz_1.py

Enter two integers, the second one being strictly positive: 1 8
Here are the generated values: [2, 5, 1, 3, 1, 4, 4, 4]

The absolute difference between first and last values is:
2

Here are the values represented as horizontal bars:

Here are the values represented as vertical bars:

$ python quiz_1.py

Enter two integers, the second one being strictly positive: 2 13
Here are the generated values: [1, 1, 1, 3, 2, 6, 6, 3, 3, 5, 2, 5, 1]

The absolute difference between first and last values is:
0

Here are the values represented as horizontal bars:

Here are the values represented as vertical bars:


请加QQ:99515681  邮箱:99515681@qq.com   WX:codinghelp









 

标签:

扫一扫在手机打开当前页
  • 上一篇:COMP643代做、代写SQL语言程序
  • 下一篇:COMP9414代做、代写Java/c++编程语言
  • 无相关信息
    昆明生活资讯

    昆明图文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹虫
    油炸竹虫
    酸笋煮鱼(鸡)
    酸笋煮鱼(鸡)
    竹筒饭
    竹筒饭
    香茅草烤鱼
    香茅草烤鱼
    柠檬烤鱼
    柠檬烤鱼
    昆明西山国家级风景名胜区
    昆明西山国家级风景名胜区
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 关于我们 | 打赏支持 | 广告服务 | 联系我们 | 网站地图 | 免责声明 | 帮助中心 | 友情链接 |

    Copyright © 2023 kmw.cc Inc. All Rights Reserved. 昆明网 版权所有
    ICP备06013414号-3 公安备 42010502001045