Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

EXAMPLE OUTPUT: Write a complete program that can read, process and display the information of 5 books. Your program will apply array of structure and

image text in transcribed

EXAMPLE OUTPUT:

image text in transcribed

Write a complete program that can read, process and display the information of 5 books. Your program will apply array of structure and array as a member Define a struct named BOOK that have members explained as follows. Give suitable names for member variables and structure variable The title of the book :cstring The price of the book : double The quantity sold for 4 consecutive years (2017 - 2020) : array of int The total quantity sold (The sum of quantity sold for 4 years) :int The gross profit (price * total sold) : double The status(determined based on total quantity sold) cstring Data() This function read all data Process() This function calculate the total quantity sold, the gross profit and determine the status based on the following table : Total Quantity Sold Status Greater 2000 "Bestseller" Greater 1000 and less or equal 2000 "Good" Less or equal 1000 "Normal" Display This function display output. Example of output is as follows: - x Microsoft Visual Studio Debug Console Title Book 1: Round the world in 80 days The Price of Book 1: 35.70 Quantity sold for year 2017 : 200 Quantity sold for year 2018 : 880 Quantity sold for year 2019 : 990 Quantity sold for year 2020 : 750 Title Book 2: Nemo the Fish The Price of Book 2: 12.50 Quantity sold for year 2017 : 400 Quantity sold for year 2018 278 Quantity sold for year 2019 : 30 Quantity sold for year 2020 : 660 Title Book 3: C++ Delicous Programming The Price of Book 3: 23.65 Quantity sold for year 2017 : 70 Quantity sold for year 2018 : 95 Quantity sold for year 2019 : 100 Quantity sold for year 2020 204 Title Book 4: The Sea shell that she sells are Sea Shore Shells The Price of Book 4: 40.40 Quantity sold for year 2017 : 111 Quantity sold for year 2018 : 222 Quantity sold for year 2019 : 333 Quantity sold for year 2020 : 444 Title Book 5: The last Blood The Price of Book 5: 69.45 Quantity sold for year 2017 : 20 Quantity sold for year 2018 : 40 Quantity sold for year 2019 : 30 Quantity sold for year 2020 : 10 REPORT 1. Book Title : Round the world in 80 days Status : Bestseller Gross Profit : RM 100674 2. Book Title : Nemo the Fish Status : Good Gross Profit : RM 17100 3. Book Title : C++ Delicous Programming Status : Normal Gross Profit : RM 11091.8 4. Book Title : The Sea Shell that she sells are Sea Shore Shells Status : Good Gross Profit : RM 44844 5. Book Title : The last Blood Status : Normal Gross Profit : RM 6945 D:\P&P BITG1233 Computer Programming\BITG1233 Seml 2021\C++ Progr am lastass Debug lastass.exe (process 9140) exited with code 0. Press any key to close this window

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

Step: 3

blur-text-image

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions