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
Jobisdone [24]
2 years ago
13

Project 12-2: Bird Counter

Computers and Technology
1 answer:
Mice21 [21]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
Write a computer program that computes the duration of a projectile’s flight and its height above the ground when it reaches the
Citrus2011 [14]

Answer:

#include <stdio.h> #define Gray 32.17 /* gravitational constant */ #include <math.h> /*cos definition*/ #define PI 3.14159265

int main(void) double Theta; /*input-angle(radians)of elevation*/ double Distance; /*input-distance (ft) to target */ double Velocity; /*input-projectile velocity (ft/sec)*/ double Time; /* output-time(sec) of flight*/ double Height; /*output-height at impact*/

printf("Enter Distance> "); scanf("%f", &Distance);

printf("Enter Radians> "); scanf("%f", &Theta);

printf("Enter Velocity> "); scanf("%f", &Velocity

Time = Distance / (Velocity * cos(Theta*PI/180.0) ) ;

Height = (Velocity *sin(Theta*PI/180.0)*Time) - Grav*(Time* Time) );

printf("The time of flight is %.3f seconds.\n", Time); printf("The height at impact is %.3f feets.\n", Height);

system("pause");

return (0);

7 0
3 years ago
T.J. wants to send a friend a file with a funny dancing cat. Which file format should T.J. use?
masha68 [24]

Answer:

If it is a Gif, then T.J. should, obviously, use the GIF format, but I think the answer you're looking for is MP3, since that is generally (at least for me) what videos are sent as!

Hope this helps(:

Explanation:

7 0
4 years ago
Read 2 more answers
Jonathan is eight years old and is a participant in a study assessing the eating habits of schoolchildren. To assess the childre
Law Incorporation [45]

Answer:

"The research team is taking measurements of Jonathan's height and weight to assess his growth"

Explanation:

Anthropometric data refers to a mass of collected information regarding an individual's different measurements such as height, weight, BMI, etc. Therefore the best way to explain this data collection method to the parents in this scenario would be to say that "The research team is taking measurements of Jonathan's height and weight to assess his growth"

7 0
4 years ago
What shows the web address of the page that is currently displayed in the workspace?
babunello [35]

Answer:

In a web browser, the address bar (also location bar or URL bar) is a GUI widget that shows the current URL. The user can type a URL into the bar to navigate to a chosen website.

6 0
3 years ago
Read 2 more answers
Which technology is used to uniquely identify a wlan network?
expeople1 [14]
The answer is SSID

SSID which in full stands for Service Set Identifier is used to identify a network. It ensures that clients are able to locate a WLAN in which they are attached to. In Layman’s terms, it’s the username or the primary name in a WiFi setup in which a user joins and is connected to.






8 0
3 years ago
Other questions:
  • Consider the following network: proxy-cache On average there are 35 objects downloaded per second, and the average object size i
    14·1 answer
  • Write a class that can make comparisons between the efficiency of the common methods from the List interface in the ArrayList an
    5·1 answer
  • Suppose that a program performs an intermixed sequence of (stack) push and pop operations. The push operations put the integers
    9·1 answer
  • Color of seagrass beds on navigational charts? Please quickly
    12·1 answer
  • If a user copies the formula D15 into D16, what would the formula read in D16?
    15·2 answers
  • Can I have help on this
    7·2 answers
  • I'm looking for the best free chat website to Answer computer and statistic question and answers
    10·2 answers
  • Asymmetric key encryption combined with the information provided by a. certificate authority allows unique identification of the
    8·1 answer
  • write a program that asks the user how far they ran and then how long they ran and prints out their speed in miles per hour java
    15·1 answer
  • 5. Played electronically by manipulating images on a television screen produced by a
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!