Program for keep track of the titles of ebooks, Programming Languages

Assignment Help:

This assignment will just focus on NookyKindle eBook orders.  That is, we'll be keeping track of the titles of eBooks and the number of orders for that particular eBook during a particular time frame (like, since the beginning of the year).

 So, the level one assignment involves using two arrays: (1) an array of Strings to store the titles of the eBooks and (2) an array of ints to store the number of orders for the corresponding eBook during the relevant period of time.  This program is about keeping track of the various eBooks that the NookyKindle eBook Corporation has been selling and keeping track of how well they are doing in terms of sales.

The two arrays mentioned above will be kept "in correspondence".  Thus, suppose the first array is called eBookList and the second array is called numOrderedList.  Then, it will always be the case that numOrderedList[k] will be the total number of orders for the eBook whose title is eBookList[k].  You may assume that a given eBook title only appears once in the array eBookList.  

Your program will involve implementing the following phases (using methods):

1) Data entry phase.  Ask the user for the number of eBook titles to be processed.  Say this value is numEBooks.  Then, you will ask the user for and get numEBooks-many pairs of values.  Each pair will contain the title of the eBook (like "WAR AND PEACE") and the total number of orders for that eBook (like 2).  Note that the book titles should be stored in upper case.  (So, "WAR AND PEACE" and not "War and Peace").  These pairs of values will be stored in the arrays eBookList and numOrderedList.

2) Data sorting phase.  This phase will involve using the bubblesort algorithm to sort the eBook data alphabetically using the (upper-cased!) names in the eBookList array.  As you rearrange the data in the eBookList array (using bubblesort), you will keep the amounts in the numOrderedList array in the correct correspondence, so that numOrderedList[k] will be maintained as the total number of orders for the eBook listed at eBookList[k].   As you swap the eBook titles during bubblesort, the corresponding number of orders will have to be swapped.

3) Data searching phase.  During this phase the user will be given the following prompt for input in a loop:

Enter eBook title or * to quit:

If the user enters '*', then the searching process will come to an end and the program will terminate.  If the user enters anything else, that input data will be treated as the title of an eBook.  The binary search algorithm will then be used to find that eBook in the sorted array, eBookList.  If that eBook is found, then the total number of orders for that eBook will be displayed.  If that eBook is not found, the program will display a message such as:

No data for that eBook was found.

The searching continues until the user enters '*' in response to the "Enter eBook title or * to quit:" prompt.  Note that the searches should not be case-sensitive.  All eBook titles should be stored in the array eBookList in upper case.  Likewise, search keys entered during the searching phase (i.e., the titles of eBooks the user is searching for) should also be upper-cased.

 (Level Two)

For the level two assignment in lieu of using two arrays to store the eBook order data use one array, an array of EBookOrderData objects.  Here is the UML diagram for a simple EBookOrderData class appropriate for this assignment:

EBookOrderData

- title : String

- orders : int

+ EBookOrderData()

+ EBookOrderData(aTitle: String,

    numOrd: int)

+ setTitle(aTitle: String) : void

+ setOrders(numOrd: int) : void

+ getTitle() : String

+ getOrders() : int

The program behavior (from the user's perspective) will be exactly the same as in the level one (non-extra-credit) assignment.  However, as the eBook order data is entered, it will be stored in an array of EBookOrderData objects.  After the data entry phase is completed, the array of EBookOrderData objects will be sorted using the bubblesort algorithm.  The EBookOrderData array will be sorted based on the titles of the eBooks (i.e., using the title field in the EBookOrderData objects in the array).

Then, the program will enter the searching phase.  When the user enters the name of an eBook to be searched for, the binary search algorithm will be used to attempt to find that eBook in the array of EBookOrderData objects.  Again, the program's behavior (from the user's perspective) will be identical to the behavior in the level one assignment.


Related Discussions:- Program for keep track of the titles of ebooks

Perl scripting, Am unable to write to file of type=file in perl script.It d...

Am unable to write to file of type=file in perl script.It does not have any extension.Help me..

Vb, sir can you help me visual basic 6.0 project solution

sir can you help me visual basic 6.0 project solution

Real distinct eigenvalues, Real Distinct Eigenvalues Under this case w...

Real Distinct Eigenvalues Under this case we'll have the real, distinct eigenvalues l 1 ≠l 2 ≠l 3 a and their related eigenvectors, ?h 1 , ?h 2 and  ?h 3   are guarantee

Query a SPARQL endpoint using JENA JAVA API, program the following exercise...

program the following exercises using JAVA and JENA API: SPARQL endpoint to be queried: QUERY:">http://services.data.gov.uk/education/sparql QUERY: What are the school’s names th

Access modifiers, Access Modifiers Convenience Modifiers or we can say (Acc...

Access Modifiers Convenience Modifiers or we can say (Access Specifies) identifies as the opportunity of accessibility of an Item and its associates. All C# kinds and kind associat

Find the dual - duality theory and complementary slackness, Linear Programm...

Linear Programming Consider the following optimization problem: min x s.t. x ≥ max{a1, a2, . . . , an} Rewrite this problem as a Linear Programming Problem. What is the

Application for a mid , The assignment has two parts: first you generate a ...

The assignment has two parts: first you generate a simple application for a MID that operates independently of other MIDs. As a second part, the application is extended to keep so

Shell script print “gm/afternoon/evening”acc to system time, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

C++, A charitable organization wants to design a special ATM machine to be ...

A charitable organization wants to design a special ATM machine to be used by needy people. The association supplies the needy person with a pin number to be able to use the ATM

Computer programming on human algorithm, 1.   You have been asked to write ...

1.   You have been asked to write a computer program that will figure out the total of an order when given the amount of the order ($200) and a sales tax rate of five percent.  I w

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd