Homework 30: Struct composition
Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Monday, April 10
- This homework contains code to be submitted electronically.
Put your code in a folder called
hw30and submit using the204subcommand. - This is an electronic homework and you do not need to print out anything to turn in during class.
Assignment
- Required reading: Sections 5 (Sorting structs) and 6 (composition of structs) from the Unit 8 notes.
-
First download the partially-complete
program
bdays.cfrom this link. This is a program to read in people's names and birthdays and then print them out in order from youngest to oldest. Most of the program has been written for you, including twostructdefinitions, two useful functions, and themainfunction. All you should change is to fill in the definitions of functionsbeforeandwrite_person.Example runs:
roche@ubuntu$./bdaysHow many people?3Bob 7/28/1991Lisa 2/13/1988Mary 1/1/2003From youngest to oldest:Mary 1/1/2003Bob 7/28/1991Lisa 2/13/1988roche@ubuntu$./bdaysHow many people?4Susan 6/13/1993Elijah 6/18/1993Anne 2/18/1993Cecil 8/3/1992From youngest to oldest:Elijah 6/18/1993Susan 6/13/1993Anne 2/18/1993Cecil 8/3/1992