Harrisburg Area Community College Harrisburg Loops and Functions Worksheet
Description
1) Create a function for each math operation (add, div, mult, sub)
2) The application will run forever, you will ask the user to continue or not.
3) create a function IsinRange() to test a value between two ranges like this;
Here is the spec in pseudo code
IsInRanhe(lr, hr, n) lr=low range
hr=high range
n=number
if n between ln and hn
return true
else
return false
Unformatted Attachment Preview
# Student Name :
# Course : ENTD220
# Instructor :
# Date : 11/26/2022
print(“This is my first programming assignment”)
lower=int(input(‘Enter your Lower range —> ‘))
higher=int(input(‘Enter your Higher range —> ‘))
while lower>higher or lower100 or higher100:
lower=int(input(‘Enter your First number —> ‘))
higher= int(input(‘Enter your Second number —> ‘))
print()
add=float(higher+lower)
print(f”The Result of {higher}+{lower}={add}”)
sub=float(higher-lower)
print(f”The Result of {higher}-{lower}={sub}”)
mult=float(higher*lower)
print(f”The Result of {higher}*{lower}={mult}”)
if lower==0:
print(“Cannot divide by Zero.”)
else:
div=float(higher/lower)
print(f”The Result of {higher}/{lower}={div}”)
print(“nThanks for using our calculator!”)
Purchase answer to see full
attachment
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."