Write a C++ program for Books. Books data should be stored in three parallel 1D arrays. The first contains the book code, second contains the total number of sold books and the third one contains the price for each book. i) Write a function, called read that reads the book's information. ii) Create the function TotalPrice that would calculate the total price of each book. ii) Create the function print that prints all the books stored in the parallel arrays in a tabular format. Create the function findBestSellingBook that would return the code of the best- iv) selling book. v) Create the function findTotalsalesByCode that would return the total number of sold books of the passed code. If code does not exist, the function should return -1. In the main function, read the values of the parallel arrays using read, print the vi) arrays in a tabular format using print, and print the code of the best-selling book using findBestSellingBook. Also in the main, ask the user to enter a code, search for it using findTotalSalesByCode, and if the book is found, display the total number of sold books; otherwise, display an error message. vii) The output of your program might look similar to the example below (user input indicated in bold). Code Number of books Price Total 212 180 15 2700 213 400 10 4000 215 100 500 The code of the top selling book is: 213 Enter the code for the total number of sales of the book> 212 The total number of sales for book 212 is 180
Write a C++ program for Books. Books data should be stored in three parallel 1D arrays. The first contains the book code, second contains the total number of sold books and the third one contains the price for each book. i) Write a function, called read that reads the book's information. ii) Create the function TotalPrice that would calculate the total price of each book. ii) Create the function print that prints all the books stored in the parallel arrays in a tabular format. Create the function findBestSellingBook that would return the code of the best- iv) selling book. v) Create the function findTotalsalesByCode that would return the total number of sold books of the passed code. If code does not exist, the function should return -1. In the main function, read the values of the parallel arrays using read, print the vi) arrays in a tabular format using print, and print the code of the best-selling book using findBestSellingBook. Also in the main, ask the user to enter a code, search for it using findTotalSalesByCode, and if the book is found, display the total number of sold books; otherwise, display an error message. vii) The output of your program might look similar to the example below (user input indicated in bold). Code Number of books Price Total 212 180 15 2700 213 400 10 4000 215 100 500 The code of the top selling book is: 213 Enter the code for the total number of sales of the book> 212 The total number of sales for book 212 is 180
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
C++, functions and arrays (please don't use hard or high level code)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education