Friday, July 16, 2021

Record Keeping App in Python

 


Machine Problem in Python


1. Create a Record Keeping App

2. This will display the following options

     a. Add Record

     b. View Records

     c. Clear All Records

     d. Exit

3. If A: The user will input the following information (name,email,address)

4. The app will save the information in a text file.

     If B, display the saved records

     If C, clear the text file and display “No records found.”

     If D, display “Thank you”

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.





Program Listing

# mod7_act1.py
# Author : Jake R. Pomperada

print("==========================================")
print(" ~ Record Keeping App ~")
print("==========================================")
print("Available Operators:")
print("A) Add Record\t\tB) View Record")
print("C) Clear Records\tD) Exit App\n")
print()
selection = str(input("Select an option [A,B,C,D]: "))

try:
file = open("record.txt", "r")
except FileNotFoundError:
file = open("record.txt", "x")

if selection.upper() == "A":
var1 = str(input("Enter Name: "))
var2 = str(input("Enter Email: "))
var3 = str(input("Enter Address: "))
file = open("record.txt", "a")
file.write(f"\n{var1}, {var2}, {var3}")
file.close()
elif selection.upper() == "B":
file = open("record.txt", "r")
print(file.read())
file.close()
elif selection.upper() == "C":
print("No records found.")
file = open("record.txt", "r+")
file.truncate(0)
file.close()
elif selection.upper() == "D":
print("Thank you")
else:
print("Invalid input.")

1 comment: