Create a new folder in CS100
called hw
.
Create a Python Program called HW2
There are 5 questions total. They are are worth 10 pts. each and may require Python code, text answers, or both. Put your text answers in you program as comments. Be sure to number which question you are answering.
### Question 1
### Write a function called carpetCalculation() that takes three parameters: length of room in feet,
### width of room in feet and cost of carpet in dollars per square yard. The function should calculate the cost of carpet
### for the room and print the results. Note: 1 yard = 3 feet, 1 square yard = 9 square feet.
### Question 2
### Write a function called normanWindowArea() that takes in two parameters the height of the window and the radius of the
### circular portion and calculates the area (amount of glass needed for the Norman window). The height is the longer dimension
### of the rectangular portion of the window.
### see link for an example of a Norman window.
### Question 3
### Write a function called tree() that draws a stick figure tree (use your creativity, but it must have at least
### four lines in it). The function should have two parameters: the x location of the tree and the y location of
### the tree. Write another function called forest() that has no parameters and it draws 7 trees in different
### locations by calling the tree() function 7 times.
### Question 4
### Write a function called drawHouse(). Use the functions that we have written in class to draw
### Rectangles and Triangles. Have the new function draw a house using at least two triangles
### and at least three rectangles. Your house should have multiple colors and multiple line thicknesses.
### Question 5
### Write a function called grid() that draws a 6x6 grid with black lines outlining each square. To draw this properly,
### you will need 7 vertical lines and 7 horizontal lines. You MUST use loops for this function. Extra challenge: Write the method
### so that it takes two parameters, the number of rows and the number of columns in the grid.
Finally, write code that calls all of your functions that demonstrates they work correctly.
You will be graded based on your written program and that the output matches what is expected. In order to receive any credit, your program must run without syntax errors in Thonny. Thonny reports syntax errors in red in the shell area; if Thonny outputs an error, your code isn’t usable. Code that doesn’t run is just text - it’s not a program. It’s an important part of programming and problem solving to come up with a solution that can be shared with others.
Double check that your program runs without syntax errors. Submit your Python program to Moodle.