Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions main_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ def enter_num():
num1 = float(input())
return num1
except:
calc.error()

calc.err()


def screen_options():
Expand Down Expand Up @@ -107,23 +106,20 @@ def screen_options():
result = calc.sine(x)
return result


elif Operation == 10:
print("Cosine")
print("Enter the number: ")
x = enter_num()
result = calc.cosine(x)
return result


elif Operation == 11:
print("Tangent")
print("Enter the number: ")
x = enter_num()
result = calc.tangent(x)
return result


elif Operation == 12:
print("Inverse Sine")
print("Enter the number: ")
Expand Down Expand Up @@ -154,15 +150,14 @@ def screen_options():
print(memStore)
return memStore


elif Operation == 16:
print("MC")
if type(memStore) != None:
print(memStore)

elif Operation == 17:
print("MCR")
store_choice = input("Do you want to clear memory? Y or N (case sensitive): ")
store_choice = capitalize(input("Do you want to clear memory? Y or N: "))
if store_choice == "Y":
memStore = 0
else:
Expand Down Expand Up @@ -266,7 +261,7 @@ def secondary_operation():
print('Empty')

elif Operation == 11:
store_choice = input("Do you want to clear memory? Y or N (case sensitive): ")
store_choice = capitalize(input("Do you want to clear memory? Y or N: "))
if store_choice == "Y":
memStore = 0
else:
Expand All @@ -277,13 +272,17 @@ def secondary_operation():
elif Operation == 12:
condi = False
print('Goodbye!')


######################################################################
## on screen ##


print("Welcome to our Calculator!")
print("How can we help you?")
print("")
def welcome():
print("Welcome to our Calculator!")
print("How can we help you?")
print("")


def main():
condi = True
Expand All @@ -292,7 +291,7 @@ def main():
print(f"Result: {returned_result}")
choose_data_type()
print("")
cont = input("Continue with current value? Y or N (case sensitive): ")
cont = capitalize(input("Do you want to clear memory? Y or N: "))
print('')
if cont == "Y":
condi2 = True
Expand All @@ -301,10 +300,15 @@ def main():
print(f"Result: {returned_result}")
choose_data_type()
print("")
cont2 = input("Continue with current value? Y or N (case sensitive): ")
cont2 = capitalize(input("Do you want to clear memory? Y or N: "))
print("")
if cont2 == "Y":
condi2 = True
else:
break
main()


if __name__ == '__main__':
main()
welcome()