Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a structure Student containing the following members: a) First Name; b) Last name; c) Date of birth (it should be in turn a structure

Design a structure Student containing the following members:

a) First Name;

b) Last name;

c) Date of birth (it should be in turn a structure containing three members Year, Month, Day);

d) Phone number;

e) Major field of study.

1. Write a function print_student_info that takes in a Student struct and print all its information.

2. Write another function search_students_by_lastname that take in an array of Student struct and string lastname as arguments and print the information of all students that match the given lastname. Use the print_student_info function in (1). If no structure matches, print a message 0 Matches found for the given lastname.

3. Write another function search_students_by_yob that search for a student born in a particular year. It should take in an array of Student struct and an int yob as arguments and then search for all students with a birth year that matches it. Use print_student_info function to print the information of the matched structures. If no structure matches, print a message 0 Matches found for the given year of birth

4. Write a main function to test the developed aforementioned functions. You should create an array of struct Student and fill it in with six students of arbitrary appropriate values. Then demonstrate the usage of search_students_by_lastname and search_students_by_yob functions.

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

what journal/ledger do these transactions belong in?

Answered: 1 week ago