1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Flauer [41]
2 years ago
15

Project 12-2: Bird Counter

Computers and Technology
1 answer:
andrey2020 [161]2 years ago
5 0

The program based on the information given is illustrated below.

<h3>How to illustrate the program?</h3>

It should be noted that a computer program is a set of instructions in a programming language for the computer to execute.

Based on the information, the program is illustrated thus:

Code:

import pickle

#function to read birds data

def readBirdsData():

try:

birdsFile = open("birdsData","rb")

birdWatcher = pickle.load(birdsFile)

birdsFile.close()

birdWatcher ={}

except EOFError:

birdWatcher ={}

return birdWatcher

#function to write the data into file using pickle

def writeBirdsData(birdWatcher):

if birdWatcher == {} :

return

sorted(birdWatcher)

birdsFile = open("birdsData","ab")

pickle.dump(birdWatcher,birdsFile)

birdsFile.close()

#function to display birds data in sorted order

def displayBirdsData(birdWatcher):

print("Name\t\tCount")

print("========\t===========")

for key in sorted(birdWatcher.keys()):

print("{}\t\t{}".format(key,birdWatcher[key]))

#main function

def main():

birdWatcher = readBirdsData()

print("Bird Counter Program")

print ("\nEnter 'x' to exit\n")

name = input("Enter name of bird: ")

while True:

#break the loop if x is entered

if name == 'x':

#if the name exists in dictionary then increase the value

if the name in birdWatcher.keys():

birdWatcher[name] = birdWatcher[name] + 1

else:

#dd it otherwise

birdWatcher[name] = 1

name = input("Enter name of bird: ")

displayBirdsData(birdWatcher)

writeBirdsData(birdWatcher)

#driver code

if __nam__ == '__main__':

main()

Learn more about programs on:

brainly.com/question/26642771

#SPJ1

You might be interested in
Which of these is not enumerated as a motivation to create accessible web content?
Gennadij [26K]

Answer:

Which of what?

Explanation:

7 0
3 years ago
Is a type of software program used to write code and develop other
Artyom0805 [142]

Answer:

Integrated development environment (IDE)

Explanation:

https://en.wikipedia.org/wiki/Integrated_development_environment

6 0
3 years ago
What is meant by polling mode in communication between software andUART and what is its disadvantage as compared to interrupt mo
g100num [7]

Answer and Explanation:

POLLING MODE: In polling mode in communication process the processor     continually check UART port for data instead of UART port signaling the process through an interrupt when data is ready as is done in interrupt mode.

 THE DISADVANTAGES AS COMPARED TO THE INTERRUPT MODE :

the disadvantages in polling mode is that the processor wastes time in checking the UART continually while in interrupt mode it is  doing useful task

until the UART interrupt this  

3 0
4 years ago
Write an overloaded constructor for the Table class that will take a single argument for the color of the table Write a set meth
creativ13 [48]

Explanation:

Below is required code in java :-

public class Table{

   private String color;    //attribute to store the color of the table

   public Table(){    //default constructor

       this.color="";   //set a default blank color

   }

   public Table(String color){    //overloaded constructor

       this.color=color;    //set the color value equal to the parameter provided

   }

   public void setColor(String color){    //setter or mutator method

       this.color=color;    //set the color value equal to the parameter provided

   }

}

8 0
4 years ago
Omar’s teacher has asked him to send her a PDF copy of his presentation via email.
Vadim26 [7]

Answer:

1. Export

2. Create PDF/XPS document

3. Standard

4. Click Publish

Explanation:

I got wrong on edg and found the correct answer

8 0
3 years ago
Other questions:
  • Which of the following is an advantage of algorithmic thinking? Select all that apply.
    6·1 answer
  • What is &lt;html&gt;
    9·2 answers
  • In microsoft what displays when the mouse pointer rests on selected text or data that can be formatted.
    8·1 answer
  • The benefits of flextime include:
    11·2 answers
  • You have just installed a SOHO router in a customer's home and the owner has called to say his son is complaining that Internet
    5·1 answer
  • Consider the following MARIE Code: 100 If, Load X /Load the first value 101 Subt Y /Subtract the value of Y, store result in AC
    8·1 answer
  • Indicate whether the following statements are true or false:
    14·2 answers
  • Write a calculate_sq_inches_of_good_pizza function that accepts the diameter of a pizza and returns the area of the pizza minus
    7·1 answer
  • What are the two extra registers that the fetch decode execute cycle uses to communicate with memory outside of the chip?
    9·1 answer
  • nder a Huffman encoding ofnsymbols with frequenciesf1, f2, . . . , fn, what is the longest a codewordcould possibly be
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!