Objective: Define a struct that keeps track of a Dog's information. Create a function that returns this struct after rec

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Objective: Define a struct that keeps track of a Dog's information. Create a function that returns this struct after rec

Post by answerhappygod »

Objective: Define a struct that keepstrack of a Dog's information. Create a function that returns thisstruct after receiving data from the user. Create a function thatprints the data from this struct to the screen.
NOTE: Creating a struct and two functions that workwith the struct are required for full credit.
Details:
1) define a struct named Dog that contains these variables:
2) define a function that creates a new variable of the Dogstruct type. This function then fills out each parameter usinginput from the user. HINT: Use thegets() function to read in strings not scanf.This function will then return the newly created Dog struct.
3) define a function that returns nothing (void) and takes a Dogstruct as its input parameters. This function will then print eachpiece of data to the string:
4) Define a main function that has a Dog struct variable type.First call your function defined in step 2 so that the Dog structis filled out with user data. Then call your second function thatprints this data to the screen. The main function should only betwo to three lines of code.
EXTRA CREDIT:
You will receive 5 extra points if you manage to define ALL ofthe functions in this homework with pass by reference structuresand the const keyword where appropriate.
Examples:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply