I am a junior student in programming. I need to write a c program for a library, which shows different book sections.
It must prompt the user to enter a section number from 1-5. Then the program must show a grid 10 columns by 10 rows, each grid entry showing a book. The program must prompt the user to enter a row, and then a column. It must tell the user if that space is already taken by a book, if it is not, one can store a book there and enter its details.
The program must also have an option , which shows the user the different sections , and shows the taken spaces by books by an 'O', and the free spaces by an '-'. The details of the books and grid sections must be entered in a file, so that the user can see which spaces are taken in the different sections.
Can someone help me please ? I will give best answer !
I am finding it difficult to create the grid and how can I store the details in the different spaces of he grid please ?
This is the main menu of the program :
This is the structured information that each space must hold :Code:int menu() { int choice = 0; do { printf("1. Show Section \n"); //then user has to specify which section, and grid of section is then shown, showing taken(O) and vacant spaces(-). printf("2. Enter new book entry\n"); //user has to specify which section , then section is shown, showing taken spaces and vacant spaces. User has to enter section , then a row and column. If space is vacant, user mus enter details of new book. Else if there is already a book , an error must be shown. printf("3. Quit\n"); printf("\nEnter choice: "); scanf("%d", &choice); } while ((choice 3)); return choice; }
How can I create the grid and relate this structure with every space in each section in the grid? Can someone help me pls ?Code:typedef struct Book { char name[50]; char author[50]; char ISBN[10]; } Book;