We will ask you and your classmates to write on the whiteboard the number of bicycles your immediate family – your parents, you, and your brothers or sisters – own. Include e-bikes, but not...


The starter file:


def main():
# Add code that reads the file n_pets.txt,
# computes the total number of pets,
# the average #, the minimum #, and the maximum #
# and displays those numbers as specified in the instructions.
main()



The data file:


2
4
6
3
2
3
4
1
3
5
5
1
1
4
4
2
2


We will ask you and your classmates to write on the whiteboard the number of<br>bicycles your immediate family – your parents, you, and your brothers or sisters –<br>own. Include e-bikes, but not motorcycles. If you don't know the exact number,<br>just give an estimate.<br>We will put the data into a file n_bikes.txt, one number per line, and will post it in<br>this assignment shortly after class.<br>Starting with the provided starter file n_bikes.py, write a program that reads the<br>data from n_bikes.txt, does some math, then displays the following on the screen:<br>Number of families:<br>Total number of bikes:<br>Average number of bikes per family:<br>Maximum number of bikes in a family:<br>Minimum number of bikes in a family:<br>once your program displays the correct results on the screen,<br>edit the program to also write the above results to a file results.txt. (Note: Don't write<br>the results to the input file n_bikes.txt, because that would replace your input data.)<br>

Extracted text: We will ask you and your classmates to write on the whiteboard the number of bicycles your immediate family – your parents, you, and your brothers or sisters – own. Include e-bikes, but not motorcycles. If you don't know the exact number, just give an estimate. We will put the data into a file n_bikes.txt, one number per line, and will post it in this assignment shortly after class. Starting with the provided starter file n_bikes.py, write a program that reads the data from n_bikes.txt, does some math, then displays the following on the screen: Number of families: Total number of bikes: Average number of bikes per family: Maximum number of bikes in a family: Minimum number of bikes in a family: once your program displays the correct results on the screen, edit the program to also write the above results to a file results.txt. (Note: Don't write the results to the input file n_bikes.txt, because that would replace your input data.)

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here