Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a solved C program done using Array. I want it to be done using Linked List. Programming Assignment (50 points) 1. Based on

This is a solved C program done using Array. I want it to be done using Linked List.

image text in transcribed

Programming Assignment (50 points) 1. Based on the previous homework, you should implement hw0691.c from scratch. The structure of this homework is similar to previous homework. In this homework, to do the same work in the previous homework, you must use a linked list instead of an array. 2. You should use a struct 'libraryRecord' with elements for Book Title Author's Name, Book Type, Book Id, Aisle number in which the book should be kept. You will be completing a program that creates a list of books (a linked list of structs). It is a menu-driven program where the user is given the following options: CSE240 - Introduction to Programming Language 1 Page Homework 06 a) Add a new book to the list. When adding a new book to the list, the user is prompted for Book Title, Author Name, Book Type, Book Id and Aisle number of the book. The book should be added at the end of the list. If the book (name or ID) already exists in the list, then you should not add to the list. The book type is an enum type. b) Display the list of books from the linked list. c) Sort the list of books numerically by ID. The sorting should happen within the list. You should not create a new list (linked list of structs) of books having sorted books. d) Delete a book from the list. When deleting a book from the list, the user is prompted for Book ID only. The book should be removed from the list and the linked list structure should be preserved /restored afterwards. Attempting to delete a book who is not in the list should return O. Otherwise, return 1 upon a successful removal of the record. The behavior of save()in this assignment is the same as that of the previous homework. However, you should modify it to new save() that handles a linked list instead of an array. Please refer to the specification of save()in the previous homework. You need to implement load() which is called at the start of the program. This function will read the saved file and fill in the linked list of structures. You need to read the file in the same order and manner that it is saved in save(). Expected output of each function: Add (10 points): Book_list.txt not found. Enter your selection: a: add a new book d: display book list r: remove a book from list s: sort book list by ID q: quit a Enter book title: Sapiens Enter author name: Yuval Enter book type (Fiction/ Nonfiction): Nonfiction Please enter book ID number: 1 Please enter aisle number: 1 Book successfully added to the list! Programming Assignment (50 points) 1. Based on the previous homework, you should implement hw0691.c from scratch. The structure of this homework is similar to previous homework. In this homework, to do the same work in the previous homework, you must use a linked list instead of an array. 2. You should use a struct 'libraryRecord' with elements for Book Title Author's Name, Book Type, Book Id, Aisle number in which the book should be kept. You will be completing a program that creates a list of books (a linked list of structs). It is a menu-driven program where the user is given the following options: CSE240 - Introduction to Programming Language 1 Page Homework 06 a) Add a new book to the list. When adding a new book to the list, the user is prompted for Book Title, Author Name, Book Type, Book Id and Aisle number of the book. The book should be added at the end of the list. If the book (name or ID) already exists in the list, then you should not add to the list. The book type is an enum type. b) Display the list of books from the linked list. c) Sort the list of books numerically by ID. The sorting should happen within the list. You should not create a new list (linked list of structs) of books having sorted books. d) Delete a book from the list. When deleting a book from the list, the user is prompted for Book ID only. The book should be removed from the list and the linked list structure should be preserved /restored afterwards. Attempting to delete a book who is not in the list should return O. Otherwise, return 1 upon a successful removal of the record. The behavior of save()in this assignment is the same as that of the previous homework. However, you should modify it to new save() that handles a linked list instead of an array. Please refer to the specification of save()in the previous homework. You need to implement load() which is called at the start of the program. This function will read the saved file and fill in the linked list of structures. You need to read the file in the same order and manner that it is saved in save(). Expected output of each function: Add (10 points): Book_list.txt not found. Enter your selection: a: add a new book d: display book list r: remove a book from list s: sort book list by ID q: quit a Enter book title: Sapiens Enter author name: Yuval Enter book type (Fiction/ Nonfiction): Nonfiction Please enter book ID number: 1 Please enter aisle number: 1 Book successfully added to the list

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions