提供高质量的essay代写,Paper代写,留学作业代写-天才代写

首頁 > > 詳細

代寫CSC1001編程、Python編程調試、Python程序代做代做SPSS|代寫留學生Prolog

CSC1001: Introduction to Computer Science
Programming Methodology
Assignment 3
Assignment description:
This assignment will be worth 9% of the final grade.
You should write your code for each question in a .py file (please name it using the
question name, e.g. q1.py). Please pack all your .py files into a single .zip file, name it using
your student ID (e.g. if your student ID is 123456, then the file should be named as
123456.zip), and then submit the .zip file via BlackBoard.
Please also write a text file, which provide the details. (Note that the report should be
submitted as PDF) The report should be included in the .zip file as well.
Please note that, the teaching assistant may ask you to explain the meaning of your
program, to ensure that the codes are indeed written by yourself. Plagiarism will not be
tolerated. We may check your code using Blackboard.
This assignment is due on 5:00PM, 23 Apr (Friday). For each day of late submission, you
will lose 10% of your mark in this assignment. If you submit more than three days later
than the deadline, you will receive zero in this assignment.
Question 1 (20% of this assignment):
Write a Python class, Flower, that has three instance variables of type str, int, and float,
that respectively represent the name of the flower, its number of petals, and its price.
(This will be the input order.) Your class must include an initializer that initializes each
variable to an appropriate value, and your class should include methods for setting the
value of each type, and retrieving the value of each type. Your program should be robust
enough to handle possible inappropriate inputs.
Question 2 (40% of this assignment):
Write a Python class that inputs a polynomial in standard algebraic notation and outputs
the first derivative of that polynomial. Both the inputted polynomial and its derivative
should be represented as strings.
For example, when the inputted polynomial is , the output of
your program should be .
Note: (1) The inputted polynomial will contain only one variable, and the variable is not
necessarily ‘x’; (2) In the inputted polynomial, the terms are not necessarily arranged in
descending or ascending orders.
Question 3 (40% of this assignment):
Write a Python class to simulate an ecosystem containing two types of creatures, bears
and fish. The ecosystem consists of a river, which is modeled as a relatively large list.
Each element of the list should be a Bear object, a Fish object, or None. In each time
step, based on a random process, each animal either attempts to move into an adjacent
list location or stay where it is. If two animals of the same type are about to collide in the
same cell, then they stay where they are, but they create a new instance of that type of
animal, which is placed in a random empty (i.e., previously None) location in the list. If a
bear and a fish collide, however, then the fish dies (i.e., it disappears).
Write an initializer for the ecosystem class, the initializer should allow the user to assign
the initial values of the river length, the number of fishes and the number of bears.
Before the simulation, fishes and bears should be allocated randomly into the river. The
ecosystem class should also contain a simulation() method, which will simulate the next
N steps of the random moving process. N should be inputted by the user. In each step of
your simulation, all animals in the river should try to take some random moves. In each
step of your simulation, the animals should take actions one by one. The animals on the
left will take actions first. (The input order: river length, fishes, bears and setps.)
For example, assume that before the simulation, the initial state of the river is:
In which, ‘F’, ‘B’ and ‘N’ denote fish, bear and empty location respectively. Assume that
in the first step of simulation, the first fish will move to the left, the first bear will move
to the right, and the second bear will remain still. Then after the first step, the state of
the river is:
To generate random numbers in Python, you should import the random() function by using
the following statement:
By assigning the return of the random() function to a variable, you will get a random
floating point number in the range of [0, 1]. The following code is an example of using the
random() function:

聯系我們
  • QQ:1067665373
  • 郵箱:1067665373@qq.com
  • 工作時間:8:00-23:00
  • 微信:Essay_Cheery
熱點文章
程序代寫更多圖片

聯系我們 - QQ: 1067665373 微信:Essay_Cheery
? 2021 uk-essays.net
程序代寫網!

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack 北美最专业的线上写作专家:网课代修,网课代做,CS代写,程序代写 代码代写,CS编程代写,java代写北美最好的一站式学术代写服务机构 美国essay代写,作业代写,✔美国网课代上-最靠谱最低价 美国代写服务,作业代写,CS编程代写,java代写,python代写,c++/c代写 代写essay,作业代写,金融代写,business代写-留学生代写平台 北美代写,美国作业代写,网课代修,Assignment代写-100%原创 北美作业代写,【essay代写】,作业【assignment代写】,网课代上代考