SlideShare a Scribd company logo
1 of 1
Download to read offline
Based on the turtle object, create a function called TurtleFlower, that uses the turtle location to
draw a square, then turn some degrees and draw another square and so on to end up with what
looks like flower petals. Do this by writing a function drawFlower that uses numOfSquares as a
parameter, then draws repeated squares based on the parameter. You will need to calculate the
angle to turn by based on the number of squares. There are two more turtle functions we can use:
begin_fill and end_fill. When begin_fill is activated it keeps track of where it started so when you
call end_fill it knows to fill in the space covered by lines; Update the code of the square flower
petals so the space is filled. **Important** Make sure you have no floating code. All statements
must be in a function. To get things started write a main function, then call it at the end. The main
function must create a turtle object and no part of your code should access the methods of the
turtle class directly. It all should be through the object.

More Related Content

More from abiwarmaa

What should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdfWhat should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdf
abiwarmaa
 
What is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdfWhat is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdf
abiwarmaa
 
Real Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdfReal Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdf
abiwarmaa
 
maincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdfmaincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdf
abiwarmaa
 

More from abiwarmaa (16)

Which of the following statements regarding DUNS is not true.pdf
Which of the following statements regarding DUNS is not true.pdfWhich of the following statements regarding DUNS is not true.pdf
Which of the following statements regarding DUNS is not true.pdf
 
What should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdfWhat should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdf
 
What is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdfWhat is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdf
 
Use maple 13 to write the code 5 Consider the polar curve r.pdf
Use maple 13 to write the code 5 Consider the polar curve r.pdfUse maple 13 to write the code 5 Consider the polar curve r.pdf
Use maple 13 to write the code 5 Consider the polar curve r.pdf
 
The table shown below gives information on a variable for fo.pdf
The table shown below gives information on a variable for fo.pdfThe table shown below gives information on a variable for fo.pdf
The table shown below gives information on a variable for fo.pdf
 
Suppose X and Y are independent Paretodistributed with cu.pdf
Suppose X and Y are independent Paretodistributed with cu.pdfSuppose X and Y are independent Paretodistributed with cu.pdf
Suppose X and Y are independent Paretodistributed with cu.pdf
 
Real Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdfReal Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdf
 
pass but that all but the most sophisticated computer progra.pdf
pass but that all but the most sophisticated computer progra.pdfpass but that all but the most sophisticated computer progra.pdf
pass but that all but the most sophisticated computer progra.pdf
 
Nur Inc is a private company that designs manufactures a.pdf
Nur Inc is a private company that designs manufactures a.pdfNur Inc is a private company that designs manufactures a.pdf
Nur Inc is a private company that designs manufactures a.pdf
 
MedTex una gran empresa farmacutica con sede en Texas qu.pdf
MedTex una gran empresa farmacutica con sede en Texas qu.pdfMedTex una gran empresa farmacutica con sede en Texas qu.pdf
MedTex una gran empresa farmacutica con sede en Texas qu.pdf
 
maincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdfmaincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdf
 
JS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdf
JS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdfJS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdf
JS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdf
 
If we had classified health worker as rich if they earned .pdf
If we had classified health worker as rich if they earned .pdfIf we had classified health worker as rich if they earned .pdf
If we had classified health worker as rich if they earned .pdf
 
Given the following class definition public class Service .pdf
Given the following class definition  public class Service .pdfGiven the following class definition  public class Service .pdf
Given the following class definition public class Service .pdf
 
C++ programming Hello I need some help with an assignment .pdf
C++ programming Hello I need some help with an assignment .pdfC++ programming Hello I need some help with an assignment .pdf
C++ programming Hello I need some help with an assignment .pdf
 
kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf
 kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf
kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Based on the turtle object create a function called TurtleF.pdf

  • 1. Based on the turtle object, create a function called TurtleFlower, that uses the turtle location to draw a square, then turn some degrees and draw another square and so on to end up with what looks like flower petals. Do this by writing a function drawFlower that uses numOfSquares as a parameter, then draws repeated squares based on the parameter. You will need to calculate the angle to turn by based on the number of squares. There are two more turtle functions we can use: begin_fill and end_fill. When begin_fill is activated it keeps track of where it started so when you call end_fill it knows to fill in the space covered by lines; Update the code of the square flower petals so the space is filled. **Important** Make sure you have no floating code. All statements must be in a function. To get things started write a main function, then call it at the end. The main function must create a turtle object and no part of your code should access the methods of the turtle class directly. It all should be through the object.