当前位置:天才代写 > C++/C代写 > 代写CS 161 Assignment 10 Library Part 2 时间留学题目

代写CS 161 Assignment 10 Library Part 2 时间留学题目

2017-09-20 08:00 星期三 所属: C++/C代写 浏览:61

CS 161
Assignment 10
Library Part 2
 

 
Assignment:  
 
Extend your previous program to provide additional functionality as follows:
 
Step (1)
 
Modify your program to use an array of structs, which will replace the parallel arrays, like this:
 
// These declarations should be at file scope.
 
struct Book {
string title;
string author;
};
 
const int ARRAY_SIZE = 1000;
Book books [ARRAY_SIZE];
 
Modify the remainder of the program to work with the new array of structs, but maintaining exactly the same functionality.
 
Step (2)
 
Add a new function to sort the array by title. The signature should be as follows:
 
void sortByTitle (int count)
 
Add a second function to sort the array by author. The signature should be as follows:
 
 void sortByAuthor (int count)
 
Using these new functions, modify your code for Show All and Search Title to display the output sorted alphabetically by title. Modify Search Author so that it displays the output in alphabetical order of author.
 
 
 
 
 
 
Sample Dialog
Note: In the example below, the user’s input is in BOLD. The program output is not.
 
Welcome to Colin’s Library Database.
Please enter the name of the backup file: C:\library.txt
14 records loaded successfully.
 
Enter Q to (Q)uit, Search (A)uthor, Search (T)itle, (S)how All: A
Author’s Name: Malik
C++ Programming: Program Design Including… (D. S. Malik)
C++ Programming: From Problem Analysis… (Malik)
2 records found.
Enter Q to (Q)uit, Search (A)uthor, Search (T)itle, (S)how All: A
Author’s Name: B
Objects First with Java (Barnes and Kolling)
Developing Games in Java (Brackeen)
Audio for Games (Brandon)
3 records found.
Enter Q to (Q)uit, Search (A)uthor, Search (T)itle, (S)how All: T
Title: Game
Audio for Games (Brandon)
Developing Games in Java (Brackeen)
Game Character Development with Maya (Ward)
Game Development Essentials (Novak)
The Game Maker's Apprentice (Overmars)
5 records found.
Enter Q to (Q)uit, Search (A)uthor, Search (T)itle, (S)how All: Q

 

    关键字:


天才代写-代写联系方式