Advertisement
Guest User

Project 4 draft

a guest
Dec 11th, 2024
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | Software | 0 0
  1. import ZewedeFormulas
  2. import math
  3.  
  4. BANNER_WIDTH = 40
  5.  
  6. def main():
  7.     doDistancePractice("DISTANCE PRACTICE")
  8.     doMidpointPractice("MIDPOINT PRACTICE")
  9.     doRadiusPractice("RADIUS PRACTICE")
  10.  
  11. def printBanner(sectionName):
  12.     global BANNER_WIDTH
  13.     print("-" * BANNER_WIDTH)
  14.     print('\t', sectionName)
  15.     print("-" * BANNER_WIDTH)
  16.  
  17. def doDistancePractice(sectionName):
  18.     printBanner(sectionName)
  19.     input("Enter x1:", )
  20.     input("Enter y1:", )
  21.     input("Enter x2:", )
  22.     input("Enter y2:", )
  23.     print("Distance =", distance,"\n")
  24.    
  25. def doMidpointPractice(section, midpointX, midpointY):
  26.     printBanner(sectionName)
  27.     mX1 = input("Enter x1:", )
  28.     mY1 = input("Enter y1:", )
  29.     mX2 = input("Enter x2:", )
  30.     mY2 = input("Enter y2:", )
  31.     print("Midpoint x =", (format(midpointX, '.4f')),"\n")
  32.     print("Midpoint y =", (format(midpointY, '.4f')),"\n")
  33.    
  34. def doRadiusPractice(sectionName, radius):
  35.     printBanner(sectionName)
  36.     input("Enter center x:", )
  37.     input("Enter center y:", )
  38.     input("Enter point x:", )
  39.     input("Enter point y:", )
  40.     print("Radius = ", radius, "\nThat wraps up practice time. See you next time!", sep = '')
  41.    
  42. main()
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement