Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete C++ program that accomplishes the task indicated below. Use good tore including comments and meaningful identilers, he accurate with the syntax-as if

image text in transcribed
Write a complete C++ program that accomplishes the task indicated below. Use good tore including comments and meaningful identilers, he accurate with the syntax-as if you tvping the program on the computer. Assume that there is a file on disk named Books. txt that contains information about all the books Sold at amazon.com. Each line contains an iRN a count that indicates how many of that book was sold. Here is a sample for the first two lines in the file 638-0-321-83389-1 230-0-328-83345-0 180 25 The first line means that 180 copies of the book with ISBN number 638-0-321-83389-1 were sold. ne the program with the assumption that you do not know how many lines are in the list. You do not need to use arrays for this program. Write a C++ program that will do the following: > Open the file For each line of data, you must: Read in the line of data from the file Call a value returning function bestSeller that returns true if the book made it on the best seller list and false otherwise. A book is a best seller if more than 100 copies were sold. Make sure that you write the code for this function. ---Compute the total number of books sold. -- Compute how many books made it on the best seller list. (not how many best seller boc were sold, just how many unique ISBNS are on the best seller list!) ---Print the ISBN number of the most sold book. ---Print the output so that it is organized as on the next page. (Of course there will be lines, because this is shown only for the first two lines above, and we don't know HC many lines are in the file). All printing is done in the main function. 11 Write a complete C++ program that accomplishes the task indicated below. Use good tore including comments and meaningful identilers, he accurate with the syntax-as if you tvping the program on the computer. Assume that there is a file on disk named Books. txt that contains information about all the books Sold at amazon.com. Each line contains an iRN a count that indicates how many of that book was sold. Here is a sample for the first two lines in the file 638-0-321-83389-1 230-0-328-83345-0 180 25 The first line means that 180 copies of the book with ISBN number 638-0-321-83389-1 were sold. ne the program with the assumption that you do not know how many lines are in the list. You do not need to use arrays for this program. Write a C++ program that will do the following: > Open the file For each line of data, you must: Read in the line of data from the file Call a value returning function bestSeller that returns true if the book made it on the best seller list and false otherwise. A book is a best seller if more than 100 copies were sold. Make sure that you write the code for this function. ---Compute the total number of books sold. -- Compute how many books made it on the best seller list. (not how many best seller boc were sold, just how many unique ISBNS are on the best seller list!) ---Print the ISBN number of the most sold book. ---Print the output so that it is organized as on the next page. (Of course there will be lines, because this is shown only for the first two lines above, and we don't know HC many lines are in the file). All printing is done in the main function. 11

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions