Let us suppose that we have 3 books (see table below), each of which contains a number of chapters and every chapter contains a number of sections. For example the book Data Structure contains 3 chapters (Queues and Stacks, Linked‐Lists, Sorting) and the chapter Queues and Stacks contains 2 sections (Queues, Stacks). Write a C++ program that will use arrays to store the information about books, chapters, and sections. The program will ask the user to enter an index and then will display the name of the book, the name of the chapter and the name of the section. For example, if the user enters 2.2.2 then the program will display:
Book: Operating Systems
Chapter: Scheduling
Section: First Come First Serve

Book Chapter/Sections
1. Data Structures 1.1 Queues and Stacks
1.1.1 Queues
1.1.2 Stacks
1.2 Linked‐Lists
1.2.1 Singly Linked‐Lists
1.2.2 Doubly Linked‐List
1.3 Sorting
1.3.1 Insertion Sort
1.3.2 Selection Sort
1.3.3 Bubble Sort
2. Operating Systems 2.1 Memory Management
2.1.1 Virtual Memory
2.1.2 Swapping
2.1.3 Page Replacement
2.1.4 Segmentation
2.2 Scheduling
2.2.1 Round Robin
2.2.2 First Come First Serve
2.2.3 Priority‐Based
3. Programming languages 3.1 Java
3.1.1 Data types
3.1.2 Conditional Statements
3.1.3 Loops
3.1.3 Networking
3.2 C++
3.2.1 Data types
3.2.2 Conditional Statements
3.2.3 Loops
3.3 Prolog
3.3.1 Facts
2.3.2 Rules
3.3.3 Rule‐base reasoning

Recommended Answers

All 2 Replies

Is there a specific problem or question about that we could help you with?

What's your question?
...assuming you're not just asking for someone to do your homework as that would be a violation of the rules.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.