Question: BOOK.txt 2D Arrays and C-type Strings Design, write, and test a program for the following. Function: This program reads in information about books and prints




BOOK.txt

2D Arrays and C-type Strings Design, write, and test a program for the following. Function: This program reads in information about books and prints out tables containing that information formatted in different ways. For each book, it reads in the title and author's name. It gives the user a choice of how the table should be ordered: by title or by author. It will print out the requested table, and then ask again for a choice. This should continue until the user enters the signal to quit. Input: The input will be from the keyboard (standard input) and consists of two parts. The first part starts out with an integer giving the number of books to be input. This is followed by input of one line for each book: the line consists of the first and last name of the author followed by the title of the book. (See sample run below.) The second part of the input simply consists of the user entering one of the following letters: A, T, or Q. The letter A will mean that the table will be sorted by the author's last name, the letter I will mean it will be sorted by the title, and the letter Q will mean the program is to halt. Output: After the information is entered the program should print out well-formatted tables showing information about each book. Depending on the user's input, the data in the table will be sorted in different ways. Sample run: (You may change the wording and format, but all information asked for should be present and easily read. The user input is in bold type.) Welcome to cs library program. Please enter the number of books: 2 For each book, please enter one line consisting the first and last names of the author follwoed by the title of the book. Hemingway Stephen The Red Badge of Courage Ernest For Whom the Bell Tolls Crane The program will display all books sorted according to your choice. Please enter your one letter choice as follows: A: sort the books by the last names of the authors T: sort the books by the titles quit this program Crane, Stephen, The Red Badge of Courage Hemingway, Ernest, For Whom the Bells Tolls The program will display all books sorted according to your choice. Please enter your one letter choice as follows: A: sort the books by the last names of the authors T: sort the books by the titles quit this program T For Whom the Bells Tolls, Hemingway, Ernest The Red Badge of Courage, Crane, Stephen The program will display all books sorted according to your choice. Please enter your one letter choice as follows: sort the books by the last names of the authors T: sort the books by the titles quit this program Q Pseudocode. You should develop a detailed pseudocode, and have it checked out by the instructor before starting to code. Programming requirements: For this and all subsequent programs, use functions! In particular, most, if not all , tasks identified in Level 0 of your pseudocode should be functions. The exception would be if the body of a function would consist of only one or two non-compound statements. For this assignment you are required to use arrays and functions and C-type strings, i.e. character arrays, and their standard functions. (This means you will need to include a header file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
