logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Kate DuggannMathematics
(5/5)

744 Answers

Hire Me
expert
Shronica MadelyOthers
(5/5)

760 Answers

Hire Me
expert
Ritesh NagarLaw
(5/5)

544 Answers

Hire Me
expert
Jason RoyComputer science
(5/5)

918 Answers

Hire Me
Others
(5/5)

Create a modular program Execute functions as needed for program processing you will create functions that display the data in animals.txt in various sort orders and grouping

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

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:

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

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

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme