CSC 150, Computer Science 1.

Added on - 16 Sep 2019

  • 1

    pages

  • 340

    words

  • 97

    views

  • 0

    downloads

Showing pages 1 to 1 of 1 pages
CSC 150, Computer Science 1Programming Assignment 7Arrays85 PointsDog AdoptionsThe total number of dogs adopted out each month from a dog shelter is stored in a data filenamed dogs.txt. The file contains up to 12 numbers, each written on a separate line. Assumethat the first amount is for January, the second for February, etc.Write a program to figure out which month had the most adoptions, which month had the leastadoptions, the total and average number of adoptions per month and the median number ofadoptions per month.Read the data from the dogs.txt file. Be sure to count the scores as you read them. Return thecount to main and use it in the rest of your program to process your partially-filled array.Your program should have separate functions to:Read the dataDisplay the number of the month with the most adoptionsDisplay the number of the month with the least adoptionsFind the total and average (mean)Sort the dataFind the medianDisplay the highest month number, lowest month number, total, average, and sorteddataDesign your program by completing the CSC 150 Program Design Document. Be sure toinclude a structure chart for the program, the prototype for each function, and a brief descriptionof each function’s purpose.Save the design in a file named DogsDesign_xxx.doc where xxx are your initials and submit it inthe Program 7 Design drop box by the date shown in the calendar – this is before the programdue date.Code your program. Save it in a file named dogs_xxx.c where xxx are your initials.Compile, run and test your program.Submit your working .c file in the Program 7 drop box by the date shown in the calendar anddrop box tools.
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document