The goal of this assignment is to give you some experience working with functions in Python. The program should display a menu with a list of conversions/calculations the program offers. The program...

1 answer below »
The goal of this assignment is to give you some experience working with functions in Python. The program should display a menu with a list of conversions/calculations the program offers. The program should ask the user for a calculation choice, data required for the calculation, perform the calculation, and display the results. The program should allow the user to perform multiple calculations and exit when they are finished using the program. The program program should offer at least 10 different conversions/calculations. Some of the calculations must require multiple inputs; you cannot have every calculation require a single input. You must create and use functions for every calculation/conversion and you must write the functions properly to accept inputs and return the result; your conversion/calculation functions should not get input from the user nor should they deliver the results to the screen.


The program should also create a text log file with all the calculations that were performed by the program. The log file should contain the date, time, operation, inputs, and results. Each line in the log file should represent one calculation that was performed. Make sure to label all values written to the log file, so that someone reading the log file would understand it.



Example Program:

*** Welcome to the CIS1051 Conversion/Calculation Program ***


Conversions Menu:
1.) Miles to Kilometers
2.) Fahrenheit to Celsius
3.) Calculate volume of a cylinder
...
11.) Exit Program
----------------------------------------------------------------------------
Enter a choice for the conversion to perform:1
Enter the miles:100
Conversion results: 160.9 kilometers
----------------------------------------------------------------------------
Enter a choice for the conversion to perform:11
Thanks for using the conversion program. Good bye for now.
Answered 1 days AfterJun 16, 2021

Answer To: The goal of this assignment is to give you some experience working with functions in Python. The...

Pulkit answered on Jun 18 2021
133 Votes
86627/code.py
from datetime import datetime
from datetime import date
file=open('logfile.txt','w')
def main():
print("*** Welcome to the CIS1051 Conversion/Calculation Program ***\n")
print("Conversions Menu:")
print("1: Body M
ass Index")
print("2: Kelvin To Celcius")
print("3: Multiply Two numbers")
print("4: Add Two numbers")
print("5: Substract Two numbers")
print("6: Bitwise AND of two numbers")
print("7: Bitwise OR of two numbers")
print("8: Bitwise XOR of two numbers")
print("9: Simple Interest Calculator")
print("10: Dollor to INR")
print("11: Exit")
n=int(input("Enter a choice for the conversion to perform:"))
if (n==1):
BMI()
main()
elif (n==2):
K2C()
main()
elif (n==3):
Multiply()
main()
elif (n==4):
addition()
main()
elif (n==5):
substract()
main()
elif (n==6):
AND()
main()
elif (n==7):
OR()
main()
elif (n==8):
XOR()
main()
elif (n==9):
SIC()
main()
elif (n==10):
D2R()
main()
elif (n==11):
EXIT()
else:
print("Invalid Choice")
m.write("Invalid Choice\n")
main()
def BMI():
file.write("\n")
today = date.today()
file.write("Today's date: "+ str(today)+"\n")
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
file.write(" Current Time ="+str(current_time)+"\n")
file.write("Body Mass Index \n")
n1=float(input("Height(in metre): "))
n2=float(input("Weight(in kg): "))
file.write("Inputs\n")
file.write("Height(in metre): "+str(n1)+"\n")
file.write("Weight(in Kg): "+str(n2)+"\n")
if n1>0:
k=n2/(n1*n1)
print("Body Mass Index : ",k)
file.write("Output\n")
file.write("Body Mass Index : "+str(k)+"\n")
else:
print("Height should be greater than 0")
file.write("Height should be greater than 0\n")

def K2C():
file.write("\n")
today = date.today()
file.write("Today's date: "+ str(today)+"\n")
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
file.write(" Current Time ="+str(current_time)+"\n")
file.write("Kelvin To Celcius \n")
n1=float(input("Temperature(in Kelvin): "))
file.write("Inputs\n")
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here