CIS 221 Programming Assignment 5a – Functions and GUI
Objectives:
· Create a modular program
· Execute functions as needed for program processing
For this assignment, you will create functions that display the data in animals.txt in various sort orders and grouping.
1. Import tkinter *, as well as messagebox and simpledialog
2. The program will have 4 global variables – 3 lists and an output string
3. The program will have 4 functions, as follows:
- Read the file
- Display all animals
- Display all by phylum
- Display individual by name
4.When the program starts, read the animals.txt file and display a message as shown:
5. When the user clicks OK, run the remainder of the program in this order:
a.Display all animals:
b.Display all animals by phylum (code for this shown below screenshot):
This is the code for displaying animals by phylum. Put this code into a function and replace the list names that I have with the appropriate list names from your own program. Notice how the output string builds up as the function executes, then a single print statement prints the entire block of information.
outMam = "" outRep = "" outBird = ""
output = "\n\n--- Animals by Phylum ---"
for i in range(len(names)): if phylum[i] == "Mammal":
outMam += "\n" + format(names[i], "10s") + diet[i] elif phylum[i] == "Bird":
outBird += "\n" + format(names[i], "10s") + diet[i] elif phylum[i] == "Reptile":
outRep += "\n" + format(names[i], "10s") + diet[i]
output += "\n\nMammals\n-------- "
output += outMam
output += "\n\nReptiles\n-------- "
output += outRep
output += "\n\nBirds\n-------- "
output += outBird print(output)
c. Display an individual animal from user input; first display a dialog box to request user input,list. Using the same index value, retrieve the diet and phylum of the animal and display theThis should work even if the user types the name with lower case letters.information about that animal (this should work for any animal that is in the original list).The final output of the entire program will look similar to this:
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme