Question: CS 1 2 0 - Yoo Project 1 Fall 2 0 2 4 DUE: 1 1 : 5 9 P . M . on September
CS Yoo Project Fall
DUE: : PM on September Sunday
PROJECT DESCRIPTION:
Implement your Math Function Library MathLibrarypy and a driver program Projectpy to test your
own math functions.
MathLibrary.py includes following three math functions defined by you:
MySqrt def MySqrt x:
To calculate square root of a positive number x using Newtons method see pseudocode below:
guess x
newGuess guess guessguess xguess
while absguess newGuess
guess newGuess
newGuess guess guessguess xguess
return newGuess
xton def xton x n
To compute x to the nth power ie xn Two input parameters: a float value x and an integer n see
pseudocode below:
if n
set product
for k in the range n
product product x
return product
if n recall that xn is simply xn
set product
for k in range n n
product product x
return product
MyLength def MyLength x y x y
To compute the distance between two pointsxy and xy using the Euclidean distance formula,
d sqrtxxyy
Projectpy includes menu function below and test codes by calling functions in
MathLibrary.py
import MathLibrary
def menu :
print
print : find the square root of the number:
print : find the x to the nth power:
print : find the length of line segment:
print : QUIT
choice int input Choose your option:
return choice
choice menu
# test the functions you defined in your Math library as below pseudocode:
while choice is not :
if choice is
display the result of the square root of
else if choice is
display the result of
else if choice is
display the length of line between point and
else if choice is
break
else
print Invalid input. Try again.
GRADING:
Your program will be graded not only on meeting the stated requirements of the project, but also on
design quality and programming style. Program should be defectfree no error A late project may be
accepted with a penalty of per day.
Collaboration on project or copying from Internet is not allowed and is considered as cheating. You are
required to observe the University and Departmental policies on academic honesty. Any requests for
special consideration relating to late projects must be discussed with and approved by the instructor in
advance.
SUBMISSION:
The project submission should in a zip file format including the files:
source code MathLibrarypy Projectpy
Snapshot of the output after running the test cases above
Use a name convention of CSProjectyourLastNameex CSProjectYoo
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
