Write a program that displays a winter scene in a graphics window. The scene must include a tree and a snowman. Hint: Use colored rectangles for the tree and white circles for the body of the snowman.
This needs to be written using Python language.
'''A simple graphic that depicts a snowman and a tree.
'''
from graphics import *
win = GraphWin('Snowman', 400, 400)
win.setBackground('cyan')
def shapes(x,y,dx,dy):
for i in range (3):
cloud = Oval(Point (y-50,x), Point(dy,80))
cloud.setFill('white')
cloud.setOutline('white')
cloud.draw(win)
shape = Oval(Point (x,y), Point(dx,dy))
shape.setFill('white')
shape.setOutline('white')
shape.draw(win)
tri = Polygon(Point(270,y-50),Point(x+170,y+10),Point(dx+200,y+10))
tri.setFill('green')
tri.setOutline('green')
tri.draw(win)
x = x-10
y = y+50
dx = dx+10
dy = dy+55
tri = Polygon(Point(x+150,y+50),Point(x+125,y-25),Point(x+175,y-25))
return shapes
def main():
land = Oval(Point(-150,280),Point(500,500))
land.setFill('gray92')
land.setOutline('gray')
land.draw(win)
trunk = Line(Point(270,200), Point(270,350))
trunk.setOutline('chocolate')
trunk.setWidth(10)
trunk.draw(win)
shapes(50,150,120,210)
eye1 = Circle(Point(70,175),5)
eye1.setFill('black')
eye1.draw(win)
eye2 = eye1.clone()
eye2.move(30,0)
eye2.draw(win)
mouth = Oval(Point(70,190),Point(100,195))
mouth.setFill('red')
mouth.draw(win)
nose = Polygon(Point(85,175), Point(80,185), Point(90,185))
nose.setFill('orange')
nose.draw(win)
rect = Rectangle(Point(20,312), Point(150,350))
rect.setFill('gray92')
rect.setOutline('gray92')
rect.draw(win)
scarf = Polygon(Point(58,205), Point(85,220),Point(85,240),Point(85,220), Point(112,205), Point(85,220))
scarf.setOutline('brown')
scarf.setWidth('10')
scarf.draw(win)
message = Text(Point(200, 20), 'Click anywhere to quit.')
message.setFill('blue')
message.draw(win)
win.getMouse()
win.close()
main()
Write a program that displays a winter scene in a graphics window. The scene must include...
USING PYTHON LANGUAGE.
QUESTION I: Write a program that displays the following table: a a^2 a 3 a14 1 1 1 1 2 4 8 16 3 9 27 81 4 16 64 256 QUESTION II: An approximate value of a number can be computed using the following formula: 7 ) Write a program that displays the result of 4 X + 7 • H) and 4 X - 를 7 tis). 9 QUESTION III: Write a program that prompts...
Write a graphics python program!!!!!!! to calculate the cost per square inch of a circular pizza and use graphics .py libaray!!!!! . Accept as input the diameter (in inches) and pizza price. Print the cost per square inch. If the cost per square inch is more than $.10 print a message that informing the user that this pizza is too expensive. Otherwise let the user know this is a good deal! and name it pizza.py.....This is a PYTHON language!!!!!!!!!!
Java program
GCompound Practice Exercise CS141 Assignment Write a class that represents a digital snowman. Your class should follow these guidelines: 1. Store the following private class variables bodyColor of type Color b. int x, int y for the upper left corner Graphics g. a. C. 2. Create two different constructor methods a. A (int x, int y, Graphics myG) parameter constructor that makes the snowman a light gray color by default and makes x and y the upper left...
Write a program that opens a specified text file and then displays a list of all the unique words found in the file. Hint: Store each word as an element of a set. USING PYTHON Please provide a screenshot of the input
In PYTHON language, develop a complete parser that executes with the scanner. You must show the execution of this program by using several relevant source lines as input, the program must show the corresponding statement recognized. Write a short report describing the work performed. Include the source program, input and output. Note - code must be written in PYTHON.
Write a program that takes a positive integer n as input from the user and displays an n by n checkerboard. (Hint: your main method could do user input then call the constructor for your GUI with n as the argument.) For example, when n = 5, there are 25 alternating white and black squares inside a square boarder. The lower right corner of the overall pattern must be white. Make sure that adjacent squares are different colors regardless of...
Program must be in Python 3.
Write a program that prompts the user to enter two strings and then displays a message indicating whether or not the first string starts with the second string. Your program must satisfy the following requirements. 1. Your program must include a function called myStartsWith that takes two string parameters. This function returns True if the rst string starts with the second string and returns False otherwise. 2. Your program must include a main function...
In python language please!
-Include your Python codes and outputs (a) Write a python program which first gets two integers a and b from the user, and then by using an if-elif-else structure, display either ("b is greater than a"), ("a is greater than b"), or ("b is equal to a") (b) use a while loop to determine and print the squares of all integers from 1 to 10
1. Use Turtle Graphics to create a tic tac toe game in Python. Write a Python program that allows for one player vs computer to play tic tac toe game, without using turtle.turtle
Project overview: Create a java graphics program that displays an order menu and bill from a Sandwich shop, or any other establishment you prefer. In this program the design is left up to the programmer however good object oriented design is required. Below are two images that should be used to assist in development of your program. Items are selected on the Order Calculator and the Message window that displays the Subtotal, Tax and Total is displayed when the Calculate...