Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please write the program in C language. and also follow the instructions given on the question. there's also a sample run. So follow that please.

image text in transcribed

image text in transcribed

please write the program in C language. and also follow the instructions given on the question. there's also a sample run. So follow that please. moreover, you will read the initial dog information from a file (dogfile.txt) to load the array.

CIS 170 Final Review Dog Years While it is common to use the formulate dog years for every 1 human year, 7 his is actually inaccurate because studies show that larger dogs age more quickly and have shorter life spans than smaller dogs Small dogs age 15 years for the first human year 8 years for the second human year 5 years for the third human year 4 years for each human year above 3 Medium dogs age 14 years for the first human year 9 years for the second human year 7 years for the third human year 5 years for each human year above 3 Large dogs age 12 years for the first human year 9 years for the second human year 8 years for the third human year 7 years for each human year above 3 Your job is to write a program that will create an array of structures that will hold dog information for up to 10 different dogs. You will read in the initial dog information from a file to load the array. You will pass the array of structures to a function called calcYears() that will calculate whether the dog is small (20 pounds or less), medium (21 to 50 pounds) or large (greater than 50 pounds) and based on its weight, determine how old the dog is in dog years This information will need to be stored in the structure as well Send the array to a function called displayDogs( which will print out the dog's name, the size of the dog (NOT weight, but Small, or Large) its age in human years and its age in dog years The main() will then ask the user if they wish to add a dog to the array. If yes function called getDogInfo() that will ask the user all of the nformation (dog's name, weight, and age). You may not send the for one dog array nor a structure. You must user pointers to capture all the information Add this user info to your array. When the user is done adding dogs to the array (up to a max of 10), send your array to the calcYears() function. You will then need to calculate the dog years using the calc and display the array with new information added in using the displayDogs() function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Refer to the expanded table below from question

Answered: 1 week ago

Question

2. Enrolling employees in courses and programs.

Answered: 1 week ago

Question

1. Communicating courses and programs to employees.

Answered: 1 week ago

Question

6. Testing equipment that will be used in instruction.

Answered: 1 week ago