COMP3140 Assignment 7 Due Date: 4/28/2021 HONOR CODE I pledge my honor that I have neither given nor received aid on this work. Do not forget to sign the honor code sheet provided by your instructor...

1 answer below »
make a gui for weight management club program


COMP3140 Assignment 7 Due Date: 4/28/2021 HONOR CODE I pledge my honor that I have neither given nor received aid on this work. Do not forget to sign the honor code sheet provided by your instructor when you complete your assignment. Your Name: 1. Modify MovingBall_Demo.py to create the following animation script. Specifications: a) The red ball moves clockwise while the blue ball moves counter clockwise b) The red ball moves 2 times as faster as the blue ball moves c) At the center of the frame, the coordinates of the balls are shown in real time. Grading: If you make only the red ball working, you receive 0-60% points If you make both red and the blue ball working, you receive 60-100% points COMP3140 Assignment 7 Due Date: 4/28/2021 2. Create GUI for the Weight Management Club program (based on Assignment 6). Specifications: a) After the user fills in all the entry fields and click on “Add” button, the program checks if the ID already exists. If yes, pop up a message box saying the member ID already exists. Otherwise add the the account to the member account set (a dictionary or list). Disply the new account at the bottom Text field. b) After the user fills in the ID field and click on “Delete” button, the program checks if the ID already exists. If yes, delete the member associated with the ID. Otherwise, pop up a message box saying the member does not exists c) After the user fills in the ID field and click on “Edit” button, the program checks if the ID already exists. If yes, the program extracts the user input from the Phnoe and Weight fileds and update this member info accordingly. Otherwise, pop up a message box saying the member does not exists. Update cannot be made. d) After the user fills in the ID field and click on “Search” button, the program checks if the ID already exists. If yes, the program displays all information (Name, Phon, Weigh, Gender) of the member associated with the ID at the corresponding widget. Otherwise, pop up a message box saying the ID does not exists. e) After the user clicks on the “View All” button, the program displays all member info at the Text widget. COMP3140 Assignment 7 Due Date: 4/28/2021 f) After the user exits the program, the program should dump all up-to-date member information to the pickle file. Grading: 1. 0-60%: Just build the GUI, depending on how many widgets are created and the alignment. 2. 61-69%: All widgets are placed on the window and are well aligned. 3. 70-79%: Some buttons work for a single account. 4. 80-89%: “Add/Delete/Edit/Search” buttons all work for local dictionary (if you use dictionary) or local list (if you use a list). 5. 90-100: Fully functional app with the GUI and driven by the user and the data stored in a pick file. Submission Requirements: Submit one single file containing all scrip code and running screenshots.
Answered Same DayApr 28, 2021

Answer To: COMP3140 Assignment 7 Due Date: 4/28/2021 HONOR CODE I pledge my honor that I have neither given nor...

Aditya answered on Apr 29 2021
147 Votes
import tkinter as tk
from tkinter import *
from tkinter import messagebox
class Person:
def __init__(self,Id, name,phone,weight,gender):
self.Id = Id;
self.name = name;
self.phone = phone

self.weight = weight
self.gender = gender

def getName(self):
return self.name

def getPhone(self):
return self.phone

def getWeight(self):
return self.weight

def getGender(self):
return self.gender

def getID(self):
return self.Id

def getData(self):
data = self.name +"\n "+str(self.Id) +"\n "+self.phone+"\n "+str(self.weight)+"\n "
return data

def GUI():
membersList = []

def exists(id):
for member in membersList:
if member.getID() == id:
return True
return False

def getDetails(id):
for member in membersList:
if member.getID() == id:
return member
return null

def deletetIndex(id):
for i in range(0, len(membersList)):
if membersList[i].getID() == id:
membersList.pop(i)
return i
return 0

def getIndex(id):
for i in range(0, len(membersList)):
if membersList[i].getID() == id:
return i
return 0

def Edit():
try:
Id = int(id_entry.get())
check = exists(Id)
if check == True:
phone = phone_entry.get()
weight = int(weight_entry.get())

index = getIndex(Id)
print(index)
obj = Person(Id,membersList[index].getName(),phone,weight,membersList[index].getGender())

membersList[index] = obj
list_box.delete(index)
list_box.insert( index,obj.getData())
id_entry.delete(0 , 'end')
name_entry.delete(0 , 'end')
phone_entry.delete(0 , 'end')
weight_entry.delete(0 , 'end')

else:
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here