Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with making a function for all the different flags In this assignment you will practice with functions and Turtle graphics. 1 of 7 e

Help with making a function for all the different flags
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
In this assignment you will practice with functions and Turtle graphics. 1 of 7 e world's 195 countries currently have national flags that include religious symbols. Of the s in this category, about half have Christian symbols (48%) and about a third include Islamic religious symbols (33%). Christianity and Islam are the world's two largest religious groups Christian symbols are found on 31 national flags from Europe, Asia and the Pacific and the Americas. These symbols includes the crosses of St. George, St. Patrick and St. Andrew Is lamic symbols are found on the flags of 21 countries in sub-Saharan Africa, the Asia-Pacific region, and the Middle East and North Africa. These symbols include an Islamic star and crescent. This assignment is conceptually simple: draw the flag of four different countries us ing turtle graphics. The exercise is to use functions Four (4) countries were chosen among the countries that has Islamic symbols on their flags and located in the two largest continents (Asia and Africa). Even though all these four countries have religious symbols in their flags, they are secular Africa Tunisia: https:/len wikipedia org/wiki Flag of Tunisia. The color red represents the blood of fallen citizens killed during the French conquest of Tunisia in 1881. The white symbolizes peace. The disk symbolizes the radiance of the nation as the sun. The crescent and five-pointed star represent unity of all Muslims and the Five Pillars of Islam, respectively -Libya The different colors in the Libyan flag represent the diferent regions of the country. The crescent stands for the Islam which is the predominant religion in the country. The star is a symbol of the smiling hope of the people of Libya. Asia Turkey: https://en.wikipedia.oru/wik/Flag of Turkey.The star is the symbol of the Turkish nation. The crescent is the symbol of the Islamic faith. The red represents the blood of the martyrs who died for both - Singapore:https:l/len.wikipedia or/wiki/Flag of Singapore. Although Singapore has a crescent and stars on its flag, they do not have religious significance. The crescent moon "represents a young nation on the ascendant, and the five stars depict Singapore's ideals of democracy, peace, progress, justice and equality." Below are the specifications for dimensions that are very useful-all dimensions are derived from a specified height (A). Tr LI Sprint - 01:55 67960 o cse.msu.edu Project Specification You must use at least the four functions specified below and one function for each country. You are encouraged to use more fanctions of your own design. For example, I found that it was useful to have a function that drew a cirele of stars Important specification: global variables are not alowed. That is, any variable names used within any function must be parameters or be created in the function. L. A function to draw a rectangle name rectangle and fills it with the color rectangle(x,y.length, height,color) This function accepts as input the starting coordinates of the rectangle, the length and height of the rectangle and the filling color Parameters: x (int), y (int), length (float), height (loat), color (string) Returns nothing 2. A function to draw a circle name circle and fills it with the color circle (x,y, radius,color) This function accepts as input the coordinates of the circle, the radius and the filling color Parameters: x (int), y (int), radius (float), color (string) . Returns nothing 3. A function to draw a crescent named crescent and fills it with the color crescent (x1,yl,x2,y2, R1,R2,c0lorl,color2) Think ofa crescent as the difference between two circles. This function accepts as input the coordinates of the starting point, the radius and the . colors for each cirele. Parameters: x1 (int), yl (int) x2 (int), y2 (int), R1 (tloat), R2 (float), colorl (string). color2 (string) . Returns nothing 4. A function to draw a five-poined star named star and fills it with the color star (x,y size,color, theta) This function draws a rotated five-pointed star. It accepts as input the starting position of the star, its size, its filling color, and the angke of the rotation Its size is the length of one edge. The angle of rotation will be the argument to turtle setheading) or turtle.seth) and is the starting point of the lower left point work ing clockwise. Parameters: x (int), y (int), size (float), color (string), theta (int) One way to draw five-pointed star is directing the turtle pointer with angke 72 and 144 interc hangeably and forwarding it with the edge size. (3605 72) " Returns nothing 5. Four (4) functions Country-flag todraw a flag ofacertain heght("A"from the specifications presented in the background section) according to the official specifications. Replace Country by the specific country name. The exception is in the position and size of stars following the exact specification of stars and their simply making stars look good close the picture and in the right orientation is satisfactory. You spacing is not worth the effort so 49 Project Specification You must use at least the four functions specified below and one function for each country. You are encouraged to use more functions of your own design. For example, I found that it was useful to have a function that drew a cirele of stars Important specification: global variables are not allowed. That is, any variable names used within any function must be parameters or be created in the function. A function to draw a rectangle name rectangle and fills it with the color rectangle(x,y,length, height, color "This function accepts as input the starting coordinates of the rectangle, the length and height of the rectangle and the filling color Parameters: x (int),y (int), length (float), height (float), color (string) .Returns nothing 2. A function to draw a circle name circle and fills it with the color circle (x,y, radius, color) This function accepts as input the coordinates of the circle, the radius and the filling color Parameters: x (int), y (int), radius (float), color (string) Returns nothing 3. A function to draw a crescent named crescent and fills it with the color crescent (x1,yl,x2, y2, R1, R2, colorl, color2) Think of a crescent as the difference between two circles This function accepts as input the coordinates of the starting point, the radius and the colors for each circle Parameters: x1 (int), yl (int), x2 (int), y2 (int), R1 (float), R2 (float), color1 (string), color2 (string) " " Returns nothing A function to draw a five-pointed star named star and fills it with the color star (x,y,size,color, theta) 4. This function draws a rotated five-pointed star. It accepts as input the starting position of the star, its size, its filling color, and the angle of the rotation. Its size is the length of one edge. The angle of rotation will be the argument to turtle.setheading) or turtle.seth0 and is the starting point of the lower left point working clockwise. Parameters: x (int), y (int), size (float), color (string), theta . (int) One way to draw five-pointed star is directing the turtle pointer with angle 72 and 144 interchangeably and forwarding it with the edge size. (360/5-72) Returns nothing 5. Four (4) functions Country-flaq to draw a flag of a certain height ("A" from the specifications presented in the background section) according to the official specifications Replace Country by the specific country name. The exception is in the position and size of stars following the exact specification of stars and their spacing is not worth the effort so simply making stars look good close the picture and in the right orientation is satisfactory. You In this assignment you will practice with functions and Turtle graphics. 1 of 7 e world's 195 countries currently have national flags that include religious symbols. Of the s in this category, about half have Christian symbols (48%) and about a third include Islamic religious symbols (33%). Christianity and Islam are the world's two largest religious groups Christian symbols are found on 31 national flags from Europe, Asia and the Pacific and the Americas. These symbols includes the crosses of St. George, St. Patrick and St. Andrew Is lamic symbols are found on the flags of 21 countries in sub-Saharan Africa, the Asia-Pacific region, and the Middle East and North Africa. These symbols include an Islamic star and crescent. This assignment is conceptually simple: draw the flag of four different countries us ing turtle graphics. The exercise is to use functions Four (4) countries were chosen among the countries that has Islamic symbols on their flags and located in the two largest continents (Asia and Africa). Even though all these four countries have religious symbols in their flags, they are secular Africa Tunisia: https:/len wikipedia org/wiki Flag of Tunisia. The color red represents the blood of fallen citizens killed during the French conquest of Tunisia in 1881. The white symbolizes peace. The disk symbolizes the radiance of the nation as the sun. The crescent and five-pointed star represent unity of all Muslims and the Five Pillars of Islam, respectively -Libya The different colors in the Libyan flag represent the diferent regions of the country. The crescent stands for the Islam which is the predominant religion in the country. The star is a symbol of the smiling hope of the people of Libya. Asia Turkey: https://en.wikipedia.oru/wik/Flag of Turkey.The star is the symbol of the Turkish nation. The crescent is the symbol of the Islamic faith. The red represents the blood of the martyrs who died for both - Singapore:https:l/len.wikipedia or/wiki/Flag of Singapore. Although Singapore has a crescent and stars on its flag, they do not have religious significance. The crescent moon "represents a young nation on the ascendant, and the five stars depict Singapore's ideals of democracy, peace, progress, justice and equality." Below are the specifications for dimensions that are very useful-all dimensions are derived from a specified height (A). Tr LI Sprint - 01:55 67960 o cse.msu.edu Project Specification You must use at least the four functions specified below and one function for each country. You are encouraged to use more fanctions of your own design. For example, I found that it was useful to have a function that drew a cirele of stars Important specification: global variables are not alowed. That is, any variable names used within any function must be parameters or be created in the function. L. A function to draw a rectangle name rectangle and fills it with the color rectangle(x,y.length, height,color) This function accepts as input the starting coordinates of the rectangle, the length and height of the rectangle and the filling color Parameters: x (int), y (int), length (float), height (loat), color (string) Returns nothing 2. A function to draw a circle name circle and fills it with the color circle (x,y, radius,color) This function accepts as input the coordinates of the circle, the radius and the filling color Parameters: x (int), y (int), radius (float), color (string) . Returns nothing 3. A function to draw a crescent named crescent and fills it with the color crescent (x1,yl,x2,y2, R1,R2,c0lorl,color2) Think ofa crescent as the difference between two circles. This function accepts as input the coordinates of the starting point, the radius and the . colors for each cirele. Parameters: x1 (int), yl (int) x2 (int), y2 (int), R1 (tloat), R2 (float), colorl (string). color2 (string) . Returns nothing 4. A function to draw a five-poined star named star and fills it with the color star (x,y size,color, theta) This function draws a rotated five-pointed star. It accepts as input the starting position of the star, its size, its filling color, and the angke of the rotation Its size is the length of one edge. The angle of rotation will be the argument to turtle setheading) or turtle.seth) and is the starting point of the lower left point work ing clockwise. Parameters: x (int), y (int), size (float), color (string), theta (int) One way to draw five-pointed star is directing the turtle pointer with angke 72 and 144 interc hangeably and forwarding it with the edge size. (3605 72) " Returns nothing 5. Four (4) functions Country-flag todraw a flag ofacertain heght("A"from the specifications presented in the background section) according to the official specifications. Replace Country by the specific country name. The exception is in the position and size of stars following the exact specification of stars and their simply making stars look good close the picture and in the right orientation is satisfactory. You spacing is not worth the effort so 49 Project Specification You must use at least the four functions specified below and one function for each country. You are encouraged to use more functions of your own design. For example, I found that it was useful to have a function that drew a cirele of stars Important specification: global variables are not allowed. That is, any variable names used within any function must be parameters or be created in the function. A function to draw a rectangle name rectangle and fills it with the color rectangle(x,y,length, height, color "This function accepts as input the starting coordinates of the rectangle, the length and height of the rectangle and the filling color Parameters: x (int),y (int), length (float), height (float), color (string) .Returns nothing 2. A function to draw a circle name circle and fills it with the color circle (x,y, radius, color) This function accepts as input the coordinates of the circle, the radius and the filling color Parameters: x (int), y (int), radius (float), color (string) Returns nothing 3. A function to draw a crescent named crescent and fills it with the color crescent (x1,yl,x2, y2, R1, R2, colorl, color2) Think of a crescent as the difference between two circles This function accepts as input the coordinates of the starting point, the radius and the colors for each circle Parameters: x1 (int), yl (int), x2 (int), y2 (int), R1 (float), R2 (float), color1 (string), color2 (string) " " Returns nothing A function to draw a five-pointed star named star and fills it with the color star (x,y,size,color, theta) 4. This function draws a rotated five-pointed star. It accepts as input the starting position of the star, its size, its filling color, and the angle of the rotation. Its size is the length of one edge. The angle of rotation will be the argument to turtle.setheading) or turtle.seth0 and is the starting point of the lower left point working clockwise. Parameters: x (int), y (int), size (float), color (string), theta . (int) One way to draw five-pointed star is directing the turtle pointer with angle 72 and 144 interchangeably and forwarding it with the edge size. (360/5-72) Returns nothing 5. Four (4) functions Country-flaq to draw a flag of a certain height ("A" from the specifications presented in the background section) according to the official specifications Replace Country by the specific country name. The exception is in the position and size of stars following the exact specification of stars and their spacing is not worth the effort so simply making stars look good close the picture and in the right orientation is satisfactory. You

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

3rd Edition

0760049041, 978-0760049044

More Books

Students also viewed these Databases questions