UNIVERSITY AT BUFFALO, THE STATE UNIVERSITY OF NEW YORK
The Department of Computer Science & Engineering
cse@buffalo
UB CSE 111

 

Homework 7

18 points
Due Wednesday July 27, 2011
  1. Write a function which converts pressure in atmospheres to pressure in mmHg (millimeters of mercury) (see this page) given input to the function (the user is not asked!) [6pts]
  2. Write a function which asks the user for two numbers, then prints out a response telling the user whether the first or second one was greater, or if they were equal. [6pts]
    Your output should look roughly like this:
    >>> numsgtlteq()
    Enter a first number: 5
    Enter a second number: 8
    Number 2 is greater than number 1.
    >>> numsgtlteq()
    Enter a first number: 8
    Enter a second number: 5
    Number 1 is greater than number 2.
    >>> numsgtlteq()
    Enter a first number: 5
    Enter a second number: 5
    Number 1 is equal to number 2.
  3. Write a python program using the turtles and for loops to draw a green pentagon and a blue hexagon. [6pts]