SlideShare a Scribd company logo
1 of 23
CS 177 – Project #1
Summer 2015
Due Date:
==========
This project is due Thursday July 9th before 11:59pm.
This assignment is an individual project and should be
completed on your own using only your own
personally written code. You will submit one (1) copy of the
completed Python program to the
Project 1 assignment on Blackboard. The completed file will
include your name, the name of the
project and a description of its functionality and purpose of in
the comments header. The file should
be named ”Project-1.py”.
This project will be the foundation of future assignments this
semester, so it is important that you
maximize your program’s functionality.
Problem Description: Simulating the Movements of Cells in a
Microscope
===============================================
===============
In 2014 Virginia scientist Eric Betzig won a Nobel Prize for his
research in microscope technology.
Since receiving the award, Betzig has improved the technology
so that cell functions, growth and
even movements can now be seen in real time while minimizing
the damage caused by prior
methods. This allows the direct study of living nerve cells
forming synapses in the brain, cells
undergoing mitosis and internal cell functions like protein
translation and mitochondrial movements.
Your assignment is to write a Python program that graphically
simulates viewing cellular organisms,
as they might be observed using Betzig’s technology. These
simulated cells will be shown in a
graphics window (representing the field of view through
Betzig’s microscope) and must be
animated, exhibiting behaviors based on the “Project
Specifications” below. The simulation will
terminate based on user input (a mouse click) and will include
two (2) types of cells, Crete and
Laelaps, (pronounced KREET and LEE-laps).
Crete cells should be represented in this simulation as three (3)
small green circles with a radius of
8 pixels. These cells move nonlinearly in steps of 1-4 graphics
window pixels. This makes their
movement appear jerky and random. Crete cells cannot move
outside the microscope slide, (the
‘field’), so they may bump along the borders or even wander out
into the middle of the field at times.
These cells have the ability to pass “through” each other.
A single red circle with a radius of 16 pixels will represent a
Laelaps cell in this simulation. Laelaps
cells move across the field straight lines, appearing to ‘bounce’
off the field boundaries. Laelaps
sometimes appear to pass through other cells, however this is an
optical illusion as they are very
thin and tend to slide over or under the other cells in the field of
view.
Project Specifications:
====================
Graphics Window
• 500 x 500 pixel window
• White background
• 0,0 (x,y) coordinate should be set to the lower left-hand corner
Crete Cells
• Three (3) green filled circles with radius of 8 pixels
• Move in random increments between -4 and 4 pixels per step
• Movements are not in straight lines, but appear wander
aimlessly
Laelaps Cells
• One (1) red filled circle with a radius of 16 pixels
• Move more quickly than Crete cells and in straight lines
• The Laelaps cell should advance in either -10 or 10 pixels per
step
TODO #1: Initialize the simulation environment
========================================
• Import any libraries needed for the simulation
• Display a welcome message in the Python Shell. Describe the
program’s functionality
• Create the 500 x 500 graphics window named “Field”
• Set the Field window parameters as specified
TODO #2: Create the Crete cells – makeCrete()
========================================
• Write a function that creates three green circle objects (radius
8) and stores them in a list
• Each entry of the list represents one Crete cell
• The starting (x, y) locations of the Crete cells will be random
values between 50 – 450
• The function should return the list of Crete cells
TODO #3: Create the Laelaps cell – makeLaelaps()
===========================================
• Write a function that creates a list containing a single entry; a
red filled circle (radius 16)
representing the Laelaps cell
• The starting (x, y) location of these cells should be random
values between 100–400
• Add two randomly selected integers to the list. They should be
either -10 or 10
• The function should return the Laelaps cell list
TODO #4: Define the bounce() function
==================================
• Write a function that accepts two (2) integers as parameters
• If the first integer is either less than 10 or greater than 490,
the function should return the
inverse value of the 2nd integer, (ie: multiplying it by -1)
• Otherwise, the function should return the 2nd integer
unmodified
TODO #5: Define the main() function
==================================
• Using the makeCrete() function, create a list of Crete cells
• Draw the Crete cells in the Field graphics window
• Using the makeLaelaps() function, create the Laelaps list
• Draw the Laelaps cell in the Field window
• Using a while loop, animate the cells in the Field window
o Animate each Crete cell by moving it’s (x,y) position by a
number of pixels specified
by a randomly selected integer between -4 and 4
o Animate the Laelaps cell by moving it’s (x,y) position by the
number of pixels
specified in the integer values in it’s list (this will always be
either -10 or 10 pixels)
o HINT: Use the bounce() function to make sure the change in a
cell’s position doesn’t
move the cell outside the Field boundaries
o End the while loop if a mouse click is detected in the Field
graphics window
• Close the Field graphics window
• Print a message that the simulation has terminated
Extra Credit Challenges: 10 points each only if TODO #1 - 5
are complete
===============================================
================
• CROSSING GUARD: Laelaps cell ‘bounces’ off the Crete
cells instead sliding past them
• NO PASSING ZONE: Crete cells bounce off each other
instead of passing through
Project 1 Grading Rubric: Points
TODO #1: Libraries imported, message shown, graphics window
created to specifications 15
TODO #2: List of three (3) circle objects is created as specified
10
TODO #2: makeCrete() function properly returns list of circle
objects 5
TODO #3: List including one circle object and 2 integers is
created as specified 10
TODO #3: makeLaelaps() function properly returns list 5
TODO #4: bounce() function created as specified 10
TODO #5: makeCrete() and makeLaelaps() functions called,
lists created successfully 10
TODO #5: Crete and LaeLaps cells drawn in the Field window 5
TODO #5: Cells move as specified within the Field window,
bouncing off boundaries 20
TODO #5: Animation loop terminates when mouse clicked in
the Field window 5
TODO #5: Message is displayed indicating the simulation has
terminated 5
Total Points 100
You will submit one (1) copy of the completed Python program
to the Project 1 assignment on
Blackboard. The completed file will include your name, the
name of the project and a description of
its functionality and purpose of in the comments header. The
file should be named ”Project-1.py”.
Coding Standards and Guidelines:
=============================
In this project, you are required to follow modular coding
standards, particularly with respect to
modular design, indentation and comments. Your score will be
affected if your code does not
conform to these standards.
Modular Design
Divide your program into functions to improve readability and
to reduce redundanct code. Your
Python code should not have repetitve copies of the same block
of statements. Instead, functions
to simplify and reduce the size of your code.
For example, if you had to find the distance between two x,y
coordinate points in several different
parts of your code, instead of creating the formula to calculate
this distance over and over again,
create a function “def distance(x1, y1, x2, y2):” and code it to
calculate and return the distance
between the point using the Pythagorean Theorum.
Indentation
Following are a few rules on how to use indentation in your
program,
• Use tabs for indentations
• Pay attention to indentation in nested for loops and if-else
blocks
Comments
Your code for this project must also include appropriate
comments about how functions are
implemented. Comments make your code more readable and
easier to understand.
• Add a comment before a function describing what it does.
• Before a nested for loop, describe what happens in the loop
and what controls the
iterations.
• Before an if-else block, explain what should happen for both
the true and false cases.
• Always make a priority of keeping the comments up-to-date
when the code changes.
For all variables that you use in your program, use meaningful
variable and function names to help
make your program more readable. Names do not have to be
long, but should give a clear
indication of the intended purpose of the variable.
Teambuilding Week IV Assessment
Only 100% original, non-plagiarized responses to include all
references and
citations.
1. Select one of the team mediation techniques (negotiation,
role clarification, or start-stop-
continue) and describe how you would use this technique to
diffuse a team conflict
situation.
Your response should be at least 200 words in length. All
sources used must be
referenced; paraphrased and quoted material must have
accompanying citations.
2. Since violated expectations often lead to conflict for
individual and team relationships,
explain some of the most common expectations that leaders and
subordinates often
violate. Share personal work-related examples to solidify your
understanding of the
concept. In addition, discuss how these types of problems were
handled in your
workplace. Were the methods used correct or incorrect? Explain
your answer.
Your response should be at least 200 words in length. All
sources used, must be
referenced; paraphrased and quoted material must have
accompanying citations.
3. Identify some of the sources of conflict often experienced in
teams. Select one of the
sources and describe an exercise the team could utilize to
overcome the conflict.
Your response should be at least 200 words in length. All
sources used, must be
referenced; paraphrased and quoted material must have
accompanying citations.
CS 177 – Project #3
Summer 2015
PROJECT 3 TEAM ASSIGNMENTS ARE POSTED ON
BLACKBOARD
YOU MUST WORK WITH YOUR ASSIGNED TEAM TO
RECEIVE CREDIT
Due Date:
==========
This project is due Saturday August 1st before 11:59pm.
This assignment is an team project and should be completed
working cooperatively with your
team members – however your team may use only Python 3 code
that has been personally written
by one of the members assigned to your team. Your team will
submit one (1) copy of the completed
Python program to the Project 3 assignment on Blackboard.
ONLY ONE TEAM MEMBER
SHOULD SUBMIT A COPY The completed file will include the
names of all you team members, the
name of the project and a description of its functionality and
purpose of in the comments header.
The file should be named ”Project-3.py”.
This project is a continuation of your earlier projects and will
be based on the Project 2 code written
by one (or more) of your team members. It is important that you
carefully choose the starting code
before beginning Project 3 to maximize your final program’s
functionality.
Problem Description: Enhancing and Finalizing the Simulation
===============================================
======
Your second Crete and Laelaps simulation program was
excellent and you have been asked to
continue to enhance it with more realistic cellular behavior.
Crete and Laelaps cells should be able to consume food dropped
in the field. In addition, the
temperature of the field should affect their movements. In
addition, the scientists have asked for the
ability to save the simulation in a given state and then be able
to restart it from that point later.
Finally, you should come up with three of your own
enhancements to the program.
Project Specifications:
====================
PROJECT 2 BASE SCENARIO:
• Start with a completed simulation that fully meets the
specifications of Project 2
• If any Project 2 specification is incomplete, they must be
finished before starting Project 3
PAUSE, SAVE & RESTART:
• When the ‘Pause’ button on the Control Panel is clicked, in
addition to pausing the
simulation, all of the current parameters and objects are saved
to a file named “simData.txt”
• A message should be printed to the IDLE window:
“Simulation Data Saved”
• The simData.txt file should include everything shown in both
the Field and Control Panel,
including but not limited to:
o All Crete and Laelaps cell locations and properties
o The location of any food in the field
o The current simulation speed and temperature settings
o Any other information that would be necessary to recreate the
simulation exactly as it
appears when it was paused
• When the program starts, if it detects a simData.txt file, before
creating any graphics
windows or objects, the user should get the option to restart
with data from the saved file
DINNER TIME:
• Any cell that contacts “food” will increase their radius by 4
pixels, (food disappears)
HOT IN HERE:
• Changing the temperature affects the cell movement speed
• Higher temperatures cause Laelaps to move faster, Crete to
move slower
• Lower temperatures cause Laelaps to move slower, Crete to
move faster
o HINT: Use the temperature value to modify the cell’s dx and
dy settings
PYTHON NINJA STYLE:
• Your team must develop three (3) further modifications to the
simulation
• These modifications should be fully described and documented
in either:
o a readme.txt file that is uploaded along with your Blackboard
submission -or-
o in comments within your project-3.py program
• The scope and functionality of these modifications are totally
up to you and your team. Up to
25 points will be awarded for each of the 3 modifications based
on functionality (it should
work as you describe) and creativity.
Project 3 Grading Rubric: Points
Simulation should meets all Project 2 Specifications
Program meets all coding standards and guidelines (see next
page) 5
PAUSE, SAVE & RESTART 10
DINNER TIME 5
HOT IN HERE 5
PYTHON NINJA STYLE #1 25
PYTHON NINJA STYLE #2 25
PYTHON NINJA STYLE #3 25
Total Points 100
This assignment is an team project and should be completed
working cooperatively with your
team members – however your team may use only Python 3 code
that has been personally written
by one of the members assigned to your team. Your team will
submit one (1) copy of the completed
Python program to the Project 3 assignment on Blackboard.
ONLY ONE TEAM MEMBER
SHOULD SUBMIT A COPY The completed file will include the
names of all you team members, the
name of the project and a description of its functionality and
purpose of in the comments header.
The file should be named ”Project-3.py”.
Coding Standards and Guidelines:
=============================
In this project, you are required to follow modular coding
standards, particularly with respect to
modular design, indentation and comments. Your score will be
affected if your code does not
conform to these standards.
Modular Design
Divide your program into functions to improve readability and
to reduce redundanct code. Your
Python code should not have repetitve copies of the same block
of statements. Instead, functions
to simplify and reduce the size of your code.
For example, if you had to find the distance between two x,y
coordinate points in several different
parts of your code, instead of creating the formula to calculate
this distance over and over again,
create a function “def distance(x1, y1, x2, y2):” and code it to
calculate and return the distance
between the point using the Pythagorean Theorum.
Indentation
Following are a few rules on how to use indentation in your
program,
• Use tabs for indentations
• Pay attention to indentation in nested for loops and if-else
blocks
Comments
Your code for this project must also include appropriate
comments about how functions are
implemented. Comments make your code more readable and
easier to understand.
• Add a comment before a function describing what it does.
• Before a nested for loop, describe what happens in the loop
and what controls the
iterations.
• Before an if-else block, explain what should happen for both
the true and false cases.
• Always make a priority of keeping the comments up-to-date
when the code changes.
For all variables that you use in your program, use meaningful
variable and function names to help
make your program more readable. Names do not have to be
long, but should give a clear
indication of the intended purpose of the variable.
import time
from graphics import *
import random
print("Welcome, this program simulates viewing cells in real
time")
win = GraphWin("Field", 500, 500)
Control = GraphWin("Control Panel",400, 300)
Control.setBackground('grey')
Control.setCoords(0, 0, 299, 199)
win.setCoords(0, 0, 499, 499)
temperature = 42
Speed = 10
def Controlpanel():
global te
global temperature
global Speed
global spe
global restart
global heat
faster = Rectangle(Point(35, 130), Point(85, 180))
faster.draw(Control)
f = Text(Point(60, 155), "faster")
f.draw(Control)
pause = Rectangle(Point(95, 130), Point(145, 180))
pause.draw(Control)
p = Text(Point(120, 155), "pause")
p.draw(Control)
food = Rectangle(Point(155, 130), Point(205, 180))
food.draw(Control)
fo = Text(Point(180, 155), "DINNER")
fo.draw(Control)
warmer = Rectangle(Point(215, 130), Point(265, 180))
warmer.draw(Control)
w = Text(Point(240, 155), "HOT")
w.draw(Control)
slower = Rectangle(Point(35, 20), Point(85, 70))
slower.draw(Control)
s = Text(Point(60, 45), "slower")
s.draw(Control)
cooler = Rectangle(Point(215, 20), Point(265, 70))
cooler.draw(Control)
c = Text(Point(240, 45), "cooler")
c.draw(Control)
speed = Rectangle(Point(95, 20), Point(145, 70))
speed.draw(Control)
speed.setOutline('grey')
speed.setFill('grey')
sp = Text(Point(120, 53), "speed")
sp.draw(Control)
spe = Text(Point(120, 30), Speed)
spe.draw(Control)
temp = Rectangle(Point(155, 20), Point(205, 70))
temp.draw(Control)
temp.setOutline('grey')
temp.setFill('grey')
t = Text(Point(180, 53), "temp")
t.draw(Control)
te = Text(Point(180, 30), temperature)
te.draw(Control)
def checkbutton(a):
Controlpanel()
flagStart =False;
global temperature
global te
global Speed
global spe
blah = Control.checkMouse()
if blah != None:
x = blah.getX()
y = blah.getY()
if (35 <= x <= 85) and (130 <= y <= 180):#make it faster
and change speed
if a > 0.05:
a -= 0.05
Speed = int(spe.getText()) + 1
spe.setText(Speed)
return a
if (95 <= x <= 145) and (130 <= y <= 180):
if(flagStart==True):
flagStart =False
return(a)
else:
file = open('simData.txt', 'w+')
file.write(str(win))
file.write(str(te))
file.write(str(a))
sim = Text(Point(120, 53), "Simulation Data Saved")
sim.draw(win)
flagStart =True
win.getMouse() #pause works correctly
elif (35 <= x <= 85) and (20 <= y <= 70):#make it slower
and change speed
a += 0.05
Speed = int(spe.getText()) - 1
spe.setText(Speed)
return a
if (155 <= x <= 205) and (130 <= y <= 180):#food
i = random.randint(5, 494)
c = random.randint(5, 494)
rec = Rectangle(Point(i, c), Point(i + 5, c + 5))
rec.setFill('black')
rec.draw(win)
if (215 <= x <= 265) and (130 <= y <= 180):#warmer
temperature = int(te.getText()) + 1
te.setText(temperature)
elif (215 <= x <= 265) and (20 <= y <= 180):#cooler
temperature = int(te.getText()) - 1
te.setText(temperature)
return(a)
def makeCrete():
mylist = []
for x in range(random.randint(5, 12)):
i = Circle(Point(random.randint(50, 451),
random.randint(50, 451)), 8)
i.setFill('green')
i.setOutline('green')
mylist.append(i)
return mylist
def makeLaelaps():
mylist2 = []
for y in range(random.randint(3, 6)):
p = Circle(Point(random.randint(100, 401),
random.randint(100, 401)), 16)
p.setFill('red')
p.setOutline('red')
laelist = [p, random.choice([-12, -10, -8, 8, 10, 12]),
random.choice([-12, -10, -8, 8, 10, 12])]
mylist2.append(laelist)
return mylist2
def bounce(int1, int2):
if int1 < 15 or int1 > 485:
return ((-1) * int2)
else:
return(int2)
def main():
Speedr = 0.25
Controlpanel()
mylist2 = makeLaelaps()
mylist = makeCrete()
for x in mylist:
x.draw(win)
for j in range(len(mylist2)):#must do range(len(mylist2)) or
they will move in a staggered way (like the Crete cells)
mylist2[j][0].draw(win)
while win.checkMouse()== None:
Speedr = checkbutton(Speedr)
time.sleep(Speedr)
# make laelaps bounce off of crete
for x in mylist:
for j in range(len(mylist2)):
pop = (x.getCenter().getX()) -
(mylist2[j][0].getCenter().getX())
crackle = (x.getCenter().getY()) -
(mylist2[j][0].getCenter().getY())
c = 28
if((pop**2) + (crackle**2) < (c**2)):
mylist2[j][1] *= (-1)
mylist2[j][2] *= (-1)
#make crete bounce off each other
for x in mylist:
pop = (x.getCenter().getX())
crackle = (x.getCenter().getY())
c = 16
if abs((pop**2) + (crackle**2) < (c**2)):
x.move(bounce((x.getCenter().getX()),
random.choice([-20, 20])), bounce((x.getCenter().getY()),
random.choice([-20, 20])))
#make laelaps bounce off each other
for j in range(len(mylist2)):
pop = (mylist2[j][0].getCenter().getX())
crackle = (mylist2[j][0].getCenter().getY())
c = 36
if abs((pop**2) + (crackle**2) < (c**2)):
mylist2[j][1] *= (-1) #have to redefine this or else it
will not move in a straight line
mylist2[j][2] *= (-1)
#makes crete cells bounce in separate directions
for x in mylist:
x.move(bounce((x.getCenter().getX()), random.randint(-
6, 6)), bounce((x.getCenter().getY()), random.randint(-6, 6)))
#laelaps bounce in separate directions
for j in range(len(mylist2)):
mylist2[j][1] = bounce(mylist2[j][0].getCenter().getX(),
mylist2[j][1])
mylist2[j][2] = bounce(mylist2[j][0].getCenter().getY(),
mylist2[j][2])
mylist2[j][0].move(mylist2[j][1], mylist2[j][2])
Control.close()
win.close()
print("This simulation has terminated!!!! Yay!!!! :) ")
main()
CS 177 – Project #1 Summer 2015  Due Date =========.docx

More Related Content

Similar to CS 177 – Project #1 Summer 2015 Due Date =========.docx

R and RMarkdown crash course
R and RMarkdown crash courseR and RMarkdown crash course
R and RMarkdown crash courseOlga Scrivner
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptxSaloniMalhotra23
 
Introduction to programming - class 2
Introduction to programming - class 2Introduction to programming - class 2
Introduction to programming - class 2Paul Brebner
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answersAkash Gawali
 
Concept lattices: a representation space to structure software variability
Concept lattices: a representation space to structure software variabilityConcept lattices: a representation space to structure software variability
Concept lattices: a representation space to structure software variabilityRa'Fat Al-Msie'deen
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationMartin Odersky
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaopenseesdays
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesAngelos Kapsimanis
 
Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Tiểu Hổ
 
Useful macros and functions for excel
Useful macros and functions for excelUseful macros and functions for excel
Useful macros and functions for excelNihar Ranjan Paital
 

Similar to CS 177 – Project #1 Summer 2015 Due Date =========.docx (20)

Data herding
Data herdingData herding
Data herding
 
Data herding
Data herdingData herding
Data herding
 
R and RMarkdown crash course
R and RMarkdown crash courseR and RMarkdown crash course
R and RMarkdown crash course
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx
 
Introduction to programming - class 2
Introduction to programming - class 2Introduction to programming - class 2
Introduction to programming - class 2
 
NPTEL_SEM_3.pdf
NPTEL_SEM_3.pdfNPTEL_SEM_3.pdf
NPTEL_SEM_3.pdf
 
1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 
Concept lattices: a representation space to structure software variability
Concept lattices: a representation space to structure software variabilityConcept lattices: a representation space to structure software variability
Concept lattices: a representation space to structure software variability
 
React native
React nativeReact native
React native
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKenna
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Software Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniquesSoftware Architectures, Week 2 - Decomposition techniques
Software Architectures, Week 2 - Decomposition techniques
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Hub102 - JS - Lesson3
Hub102 - JS - Lesson3
 
Useful macros and functions for excel
Useful macros and functions for excelUseful macros and functions for excel
Useful macros and functions for excel
 

More from faithxdunce63732

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxfaithxdunce63732
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxfaithxdunce63732
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxfaithxdunce63732
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxfaithxdunce63732
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxfaithxdunce63732
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxfaithxdunce63732
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxfaithxdunce63732
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxfaithxdunce63732
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxfaithxdunce63732
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxfaithxdunce63732
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxfaithxdunce63732
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxfaithxdunce63732
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxfaithxdunce63732
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxfaithxdunce63732
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxfaithxdunce63732
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxfaithxdunce63732
 

More from faithxdunce63732 (20)

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docx
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docx
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docx
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docx
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docx
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docx
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docx
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docx
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docx
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docx
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docx
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docx
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docx
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docx
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docx
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docx
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docx
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docx
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

CS 177 – Project #1 Summer 2015 Due Date =========.docx

  • 1. CS 177 – Project #1 Summer 2015 Due Date: ========== This project is due Thursday July 9th before 11:59pm. This assignment is an individual project and should be completed on your own using only your own personally written code. You will submit one (1) copy of the completed Python program to the Project 1 assignment on Blackboard. The completed file will include your name, the name of the project and a description of its functionality and purpose of in the comments header. The file should be named ”Project-1.py”. This project will be the foundation of future assignments this semester, so it is important that you maximize your program’s functionality. Problem Description: Simulating the Movements of Cells in a Microscope =============================================== =============== In 2014 Virginia scientist Eric Betzig won a Nobel Prize for his research in microscope technology. Since receiving the award, Betzig has improved the technology so that cell functions, growth and even movements can now be seen in real time while minimizing the damage caused by prior
  • 2. methods. This allows the direct study of living nerve cells forming synapses in the brain, cells undergoing mitosis and internal cell functions like protein translation and mitochondrial movements. Your assignment is to write a Python program that graphically simulates viewing cellular organisms, as they might be observed using Betzig’s technology. These simulated cells will be shown in a graphics window (representing the field of view through Betzig’s microscope) and must be animated, exhibiting behaviors based on the “Project Specifications” below. The simulation will terminate based on user input (a mouse click) and will include two (2) types of cells, Crete and Laelaps, (pronounced KREET and LEE-laps). Crete cells should be represented in this simulation as three (3) small green circles with a radius of 8 pixels. These cells move nonlinearly in steps of 1-4 graphics window pixels. This makes their movement appear jerky and random. Crete cells cannot move outside the microscope slide, (the ‘field’), so they may bump along the borders or even wander out into the middle of the field at times. These cells have the ability to pass “through” each other. A single red circle with a radius of 16 pixels will represent a Laelaps cell in this simulation. Laelaps cells move across the field straight lines, appearing to ‘bounce’ off the field boundaries. Laelaps sometimes appear to pass through other cells, however this is an optical illusion as they are very
  • 3. thin and tend to slide over or under the other cells in the field of view. Project Specifications: ==================== Graphics Window • 500 x 500 pixel window • White background • 0,0 (x,y) coordinate should be set to the lower left-hand corner Crete Cells • Three (3) green filled circles with radius of 8 pixels • Move in random increments between -4 and 4 pixels per step • Movements are not in straight lines, but appear wander aimlessly Laelaps Cells • One (1) red filled circle with a radius of 16 pixels • Move more quickly than Crete cells and in straight lines • The Laelaps cell should advance in either -10 or 10 pixels per step TODO #1: Initialize the simulation environment ======================================== • Import any libraries needed for the simulation • Display a welcome message in the Python Shell. Describe the
  • 4. program’s functionality • Create the 500 x 500 graphics window named “Field” • Set the Field window parameters as specified TODO #2: Create the Crete cells – makeCrete() ======================================== • Write a function that creates three green circle objects (radius 8) and stores them in a list • Each entry of the list represents one Crete cell • The starting (x, y) locations of the Crete cells will be random values between 50 – 450 • The function should return the list of Crete cells TODO #3: Create the Laelaps cell – makeLaelaps() =========================================== • Write a function that creates a list containing a single entry; a red filled circle (radius 16) representing the Laelaps cell • The starting (x, y) location of these cells should be random values between 100–400 • Add two randomly selected integers to the list. They should be either -10 or 10 • The function should return the Laelaps cell list TODO #4: Define the bounce() function ==================================
  • 5. • Write a function that accepts two (2) integers as parameters • If the first integer is either less than 10 or greater than 490, the function should return the inverse value of the 2nd integer, (ie: multiplying it by -1) • Otherwise, the function should return the 2nd integer unmodified TODO #5: Define the main() function ================================== • Using the makeCrete() function, create a list of Crete cells • Draw the Crete cells in the Field graphics window • Using the makeLaelaps() function, create the Laelaps list • Draw the Laelaps cell in the Field window • Using a while loop, animate the cells in the Field window o Animate each Crete cell by moving it’s (x,y) position by a number of pixels specified by a randomly selected integer between -4 and 4 o Animate the Laelaps cell by moving it’s (x,y) position by the number of pixels specified in the integer values in it’s list (this will always be either -10 or 10 pixels) o HINT: Use the bounce() function to make sure the change in a cell’s position doesn’t move the cell outside the Field boundaries o End the while loop if a mouse click is detected in the Field graphics window • Close the Field graphics window • Print a message that the simulation has terminated
  • 6. Extra Credit Challenges: 10 points each only if TODO #1 - 5 are complete =============================================== ================ • CROSSING GUARD: Laelaps cell ‘bounces’ off the Crete cells instead sliding past them • NO PASSING ZONE: Crete cells bounce off each other instead of passing through Project 1 Grading Rubric: Points TODO #1: Libraries imported, message shown, graphics window created to specifications 15 TODO #2: List of three (3) circle objects is created as specified 10 TODO #2: makeCrete() function properly returns list of circle objects 5 TODO #3: List including one circle object and 2 integers is created as specified 10 TODO #3: makeLaelaps() function properly returns list 5 TODO #4: bounce() function created as specified 10 TODO #5: makeCrete() and makeLaelaps() functions called, lists created successfully 10 TODO #5: Crete and LaeLaps cells drawn in the Field window 5 TODO #5: Cells move as specified within the Field window, bouncing off boundaries 20 TODO #5: Animation loop terminates when mouse clicked in
  • 7. the Field window 5 TODO #5: Message is displayed indicating the simulation has terminated 5 Total Points 100 You will submit one (1) copy of the completed Python program to the Project 1 assignment on Blackboard. The completed file will include your name, the name of the project and a description of its functionality and purpose of in the comments header. The file should be named ”Project-1.py”. Coding Standards and Guidelines: ============================= In this project, you are required to follow modular coding standards, particularly with respect to modular design, indentation and comments. Your score will be affected if your code does not conform to these standards. Modular Design Divide your program into functions to improve readability and to reduce redundanct code. Your Python code should not have repetitve copies of the same block of statements. Instead, functions to simplify and reduce the size of your code. For example, if you had to find the distance between two x,y coordinate points in several different parts of your code, instead of creating the formula to calculate this distance over and over again, create a function “def distance(x1, y1, x2, y2):” and code it to
  • 8. calculate and return the distance between the point using the Pythagorean Theorum. Indentation Following are a few rules on how to use indentation in your program, • Use tabs for indentations • Pay attention to indentation in nested for loops and if-else blocks Comments Your code for this project must also include appropriate comments about how functions are implemented. Comments make your code more readable and easier to understand. • Add a comment before a function describing what it does. • Before a nested for loop, describe what happens in the loop and what controls the iterations. • Before an if-else block, explain what should happen for both the true and false cases. • Always make a priority of keeping the comments up-to-date when the code changes. For all variables that you use in your program, use meaningful variable and function names to help make your program more readable. Names do not have to be long, but should give a clear indication of the intended purpose of the variable.
  • 9. Teambuilding Week IV Assessment Only 100% original, non-plagiarized responses to include all references and citations. 1. Select one of the team mediation techniques (negotiation, role clarification, or start-stop- continue) and describe how you would use this technique to diffuse a team conflict situation. Your response should be at least 200 words in length. All sources used must be referenced; paraphrased and quoted material must have accompanying citations. 2. Since violated expectations often lead to conflict for individual and team relationships, explain some of the most common expectations that leaders and subordinates often violate. Share personal work-related examples to solidify your understanding of the concept. In addition, discuss how these types of problems were handled in your workplace. Were the methods used correct or incorrect? Explain your answer. Your response should be at least 200 words in length. All sources used, must be
  • 10. referenced; paraphrased and quoted material must have accompanying citations. 3. Identify some of the sources of conflict often experienced in teams. Select one of the sources and describe an exercise the team could utilize to overcome the conflict. Your response should be at least 200 words in length. All sources used, must be referenced; paraphrased and quoted material must have accompanying citations. CS 177 – Project #3 Summer 2015 PROJECT 3 TEAM ASSIGNMENTS ARE POSTED ON BLACKBOARD YOU MUST WORK WITH YOUR ASSIGNED TEAM TO RECEIVE CREDIT Due Date: ========== This project is due Saturday August 1st before 11:59pm. This assignment is an team project and should be completed working cooperatively with your team members – however your team may use only Python 3 code that has been personally written
  • 11. by one of the members assigned to your team. Your team will submit one (1) copy of the completed Python program to the Project 3 assignment on Blackboard. ONLY ONE TEAM MEMBER SHOULD SUBMIT A COPY The completed file will include the names of all you team members, the name of the project and a description of its functionality and purpose of in the comments header. The file should be named ”Project-3.py”. This project is a continuation of your earlier projects and will be based on the Project 2 code written by one (or more) of your team members. It is important that you carefully choose the starting code before beginning Project 3 to maximize your final program’s functionality. Problem Description: Enhancing and Finalizing the Simulation =============================================== ====== Your second Crete and Laelaps simulation program was excellent and you have been asked to continue to enhance it with more realistic cellular behavior. Crete and Laelaps cells should be able to consume food dropped in the field. In addition, the temperature of the field should affect their movements. In addition, the scientists have asked for the ability to save the simulation in a given state and then be able to restart it from that point later. Finally, you should come up with three of your own enhancements to the program.
  • 12. Project Specifications: ==================== PROJECT 2 BASE SCENARIO: • Start with a completed simulation that fully meets the specifications of Project 2 • If any Project 2 specification is incomplete, they must be finished before starting Project 3 PAUSE, SAVE & RESTART: • When the ‘Pause’ button on the Control Panel is clicked, in addition to pausing the simulation, all of the current parameters and objects are saved to a file named “simData.txt” • A message should be printed to the IDLE window: “Simulation Data Saved” • The simData.txt file should include everything shown in both the Field and Control Panel, including but not limited to: o All Crete and Laelaps cell locations and properties o The location of any food in the field o The current simulation speed and temperature settings o Any other information that would be necessary to recreate the simulation exactly as it appears when it was paused • When the program starts, if it detects a simData.txt file, before
  • 13. creating any graphics windows or objects, the user should get the option to restart with data from the saved file DINNER TIME: • Any cell that contacts “food” will increase their radius by 4 pixels, (food disappears) HOT IN HERE: • Changing the temperature affects the cell movement speed • Higher temperatures cause Laelaps to move faster, Crete to move slower • Lower temperatures cause Laelaps to move slower, Crete to move faster o HINT: Use the temperature value to modify the cell’s dx and dy settings PYTHON NINJA STYLE: • Your team must develop three (3) further modifications to the simulation • These modifications should be fully described and documented in either: o a readme.txt file that is uploaded along with your Blackboard submission -or- o in comments within your project-3.py program • The scope and functionality of these modifications are totally up to you and your team. Up to 25 points will be awarded for each of the 3 modifications based on functionality (it should
  • 14. work as you describe) and creativity. Project 3 Grading Rubric: Points Simulation should meets all Project 2 Specifications Program meets all coding standards and guidelines (see next page) 5 PAUSE, SAVE & RESTART 10 DINNER TIME 5 HOT IN HERE 5 PYTHON NINJA STYLE #1 25 PYTHON NINJA STYLE #2 25 PYTHON NINJA STYLE #3 25 Total Points 100 This assignment is an team project and should be completed working cooperatively with your team members – however your team may use only Python 3 code that has been personally written by one of the members assigned to your team. Your team will submit one (1) copy of the completed Python program to the Project 3 assignment on Blackboard. ONLY ONE TEAM MEMBER
  • 15. SHOULD SUBMIT A COPY The completed file will include the names of all you team members, the name of the project and a description of its functionality and purpose of in the comments header. The file should be named ”Project-3.py”. Coding Standards and Guidelines: ============================= In this project, you are required to follow modular coding standards, particularly with respect to modular design, indentation and comments. Your score will be affected if your code does not conform to these standards. Modular Design Divide your program into functions to improve readability and to reduce redundanct code. Your Python code should not have repetitve copies of the same block of statements. Instead, functions to simplify and reduce the size of your code. For example, if you had to find the distance between two x,y coordinate points in several different parts of your code, instead of creating the formula to calculate this distance over and over again, create a function “def distance(x1, y1, x2, y2):” and code it to calculate and return the distance between the point using the Pythagorean Theorum. Indentation Following are a few rules on how to use indentation in your program,
  • 16. • Use tabs for indentations • Pay attention to indentation in nested for loops and if-else blocks Comments Your code for this project must also include appropriate comments about how functions are implemented. Comments make your code more readable and easier to understand. • Add a comment before a function describing what it does. • Before a nested for loop, describe what happens in the loop and what controls the iterations. • Before an if-else block, explain what should happen for both the true and false cases. • Always make a priority of keeping the comments up-to-date when the code changes. For all variables that you use in your program, use meaningful variable and function names to help make your program more readable. Names do not have to be long, but should give a clear indication of the intended purpose of the variable. import time from graphics import *
  • 17. import random print("Welcome, this program simulates viewing cells in real time") win = GraphWin("Field", 500, 500) Control = GraphWin("Control Panel",400, 300) Control.setBackground('grey') Control.setCoords(0, 0, 299, 199) win.setCoords(0, 0, 499, 499) temperature = 42 Speed = 10 def Controlpanel(): global te global temperature global Speed global spe global restart global heat faster = Rectangle(Point(35, 130), Point(85, 180)) faster.draw(Control) f = Text(Point(60, 155), "faster") f.draw(Control) pause = Rectangle(Point(95, 130), Point(145, 180)) pause.draw(Control) p = Text(Point(120, 155), "pause") p.draw(Control) food = Rectangle(Point(155, 130), Point(205, 180)) food.draw(Control) fo = Text(Point(180, 155), "DINNER") fo.draw(Control) warmer = Rectangle(Point(215, 130), Point(265, 180)) warmer.draw(Control)
  • 18. w = Text(Point(240, 155), "HOT") w.draw(Control) slower = Rectangle(Point(35, 20), Point(85, 70)) slower.draw(Control) s = Text(Point(60, 45), "slower") s.draw(Control) cooler = Rectangle(Point(215, 20), Point(265, 70)) cooler.draw(Control) c = Text(Point(240, 45), "cooler") c.draw(Control) speed = Rectangle(Point(95, 20), Point(145, 70)) speed.draw(Control) speed.setOutline('grey') speed.setFill('grey') sp = Text(Point(120, 53), "speed") sp.draw(Control) spe = Text(Point(120, 30), Speed) spe.draw(Control) temp = Rectangle(Point(155, 20), Point(205, 70)) temp.draw(Control) temp.setOutline('grey') temp.setFill('grey') t = Text(Point(180, 53), "temp") t.draw(Control) te = Text(Point(180, 30), temperature) te.draw(Control) def checkbutton(a): Controlpanel() flagStart =False; global temperature
  • 19. global te global Speed global spe blah = Control.checkMouse() if blah != None: x = blah.getX() y = blah.getY() if (35 <= x <= 85) and (130 <= y <= 180):#make it faster and change speed if a > 0.05: a -= 0.05 Speed = int(spe.getText()) + 1 spe.setText(Speed) return a if (95 <= x <= 145) and (130 <= y <= 180): if(flagStart==True): flagStart =False return(a) else: file = open('simData.txt', 'w+') file.write(str(win)) file.write(str(te)) file.write(str(a)) sim = Text(Point(120, 53), "Simulation Data Saved") sim.draw(win) flagStart =True win.getMouse() #pause works correctly elif (35 <= x <= 85) and (20 <= y <= 70):#make it slower and change speed a += 0.05 Speed = int(spe.getText()) - 1 spe.setText(Speed) return a if (155 <= x <= 205) and (130 <= y <= 180):#food i = random.randint(5, 494)
  • 20. c = random.randint(5, 494) rec = Rectangle(Point(i, c), Point(i + 5, c + 5)) rec.setFill('black') rec.draw(win) if (215 <= x <= 265) and (130 <= y <= 180):#warmer temperature = int(te.getText()) + 1 te.setText(temperature) elif (215 <= x <= 265) and (20 <= y <= 180):#cooler temperature = int(te.getText()) - 1 te.setText(temperature) return(a) def makeCrete(): mylist = [] for x in range(random.randint(5, 12)): i = Circle(Point(random.randint(50, 451), random.randint(50, 451)), 8) i.setFill('green') i.setOutline('green') mylist.append(i) return mylist def makeLaelaps(): mylist2 = [] for y in range(random.randint(3, 6)): p = Circle(Point(random.randint(100, 401), random.randint(100, 401)), 16) p.setFill('red') p.setOutline('red') laelist = [p, random.choice([-12, -10, -8, 8, 10, 12]), random.choice([-12, -10, -8, 8, 10, 12])] mylist2.append(laelist) return mylist2 def bounce(int1, int2):
  • 21. if int1 < 15 or int1 > 485: return ((-1) * int2) else: return(int2) def main(): Speedr = 0.25 Controlpanel() mylist2 = makeLaelaps() mylist = makeCrete() for x in mylist: x.draw(win) for j in range(len(mylist2)):#must do range(len(mylist2)) or they will move in a staggered way (like the Crete cells) mylist2[j][0].draw(win) while win.checkMouse()== None: Speedr = checkbutton(Speedr) time.sleep(Speedr) # make laelaps bounce off of crete for x in mylist: for j in range(len(mylist2)): pop = (x.getCenter().getX()) - (mylist2[j][0].getCenter().getX()) crackle = (x.getCenter().getY()) - (mylist2[j][0].getCenter().getY()) c = 28 if((pop**2) + (crackle**2) < (c**2)): mylist2[j][1] *= (-1) mylist2[j][2] *= (-1) #make crete bounce off each other for x in mylist: pop = (x.getCenter().getX()) crackle = (x.getCenter().getY()) c = 16
  • 22. if abs((pop**2) + (crackle**2) < (c**2)): x.move(bounce((x.getCenter().getX()), random.choice([-20, 20])), bounce((x.getCenter().getY()), random.choice([-20, 20]))) #make laelaps bounce off each other for j in range(len(mylist2)): pop = (mylist2[j][0].getCenter().getX()) crackle = (mylist2[j][0].getCenter().getY()) c = 36 if abs((pop**2) + (crackle**2) < (c**2)): mylist2[j][1] *= (-1) #have to redefine this or else it will not move in a straight line mylist2[j][2] *= (-1) #makes crete cells bounce in separate directions for x in mylist: x.move(bounce((x.getCenter().getX()), random.randint(- 6, 6)), bounce((x.getCenter().getY()), random.randint(-6, 6))) #laelaps bounce in separate directions for j in range(len(mylist2)): mylist2[j][1] = bounce(mylist2[j][0].getCenter().getX(), mylist2[j][1]) mylist2[j][2] = bounce(mylist2[j][0].getCenter().getY(), mylist2[j][2]) mylist2[j][0].move(mylist2[j][1], mylist2[j][2]) Control.close() win.close() print("This simulation has terminated!!!! Yay!!!! :) ") main()