Project#4 -...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 inventory.h #ifndef _inventory_h #define _inventory_h #define ERROR_INVALID_SEARCH_OPTION "Invalid search option.\n" #define ERROR_NO_BOOK_FOUND "No book found matching the search criterion.\n" #define MAXIMUM_TITLE 20 #define MAXIMUM_AUTHOR 20 #define MAXIMUM_BOOKS 10 typedef struct{ char subject[MAXIMUM_TITLE] char author[MAXIMUM_AUTHOR] int year int edition float price }Book typedef struct { Book booksFound[MAXIMUM_BOOKS] int searchMatches } BookSearchResult /*Interface functions for this application.*/ /*function to read the book information. It returns the structure of type book*/ Book getBookInformation(void) BookSearchResult searchBook(Book [], int size, int option, int value) void displayResult(Book [], int) #endif ____________________________________________________________________________________________________ inventory.c #include<stdio.h> #include<stdlib.h> #include "inventory.h" int main(void){ int size,i,option,value Book book_data[MAXIMUM_BOOKS] BookSearchResult result
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Sheet1 Page 2 printf("Enter the number of books in the inventory: \n") scanf("%d",&size) /*get book information*/ for(i=0 book_data[i]=getBookInformation()
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern