Exam 1_Spring 2011

# Write the following formulas in python a dist x1 x2

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: = thu = mon thu = mon - 2 * tue = wed * mon mon, tue = tue, %2 +2 tue mon 3. Write the following formulas in Python: ￿ (a) dist = (x1 − x2 )2 + (y1 − y2 )2 (b) area = √ 33 2 2 side apothem = 2area 6side 4. Write for loop based Python code to calculate: (a) The product of all the integers from 20 to 200. (b) 5100 . 5. Write a Python graphics based program that requires the user to click on four points in its window. The program then draws, in its window, the quadrilateral connecting these four points in the order in which they were entered and closing at the ﬁrst and last points entered. 6. Write for loop based Python code to do the following: (a) Print out the multiples of 7 from 77 to 700 inclusive. Note: The ﬁrst thing printed will be 77 and the last thing printed will be 700. (b) Print the following output: City City City City City City City City City 1 2 3 4 5 6 7 8 9 has has has has has has has has has 30 flights. 2 flights. 12 flights. 24 flights. 31 flights. 44 flights. 3 flights. 33 flights. 8 flights. 7. Write a Pyth...
View Full Document

## This document was uploaded on 03/24/2014 for the course CMP 230 at Lehman College.

Ask a homework question - tutors are online