Create a java program

Assignment Help JAVA Programming
Reference no: EM13609

A. This adds storage of the MainData as an external random access file with id as key to allow ListAll and Query transactions based on id. It also still allows ListAll and Query transactions based on name (using NameIndex) to show the actual data rather than just id (as A1 did).

B. A2 uses binary files (rather than plain ASCII text files) for both MainData file and NameIndexBackup file. NameIndex's save and load methods will thus need changing to accommodate a binary file. And PrettyPrintUtility also has to be changed and extended to deal with these two binary files.

C. Because there is now a lot more processing needed for each raw data record, RawData class must be changed. It will now handle only things pertaining to the RawData FILE, per se (i.e., open it in the constructor, close it in FinishUp method, read a single record/line in InputOneCountry method). The NEW RawDataRecord class (in a physically separate code file) will handle splitting the record into fields, the actual field storage itself, and the appropriate getters and setters for cleaning/converting the fields, as appropriate.

D. This new class provides ready-built services and storage for use by UserApp when processing IN transactions since the restOfTransRecord is exactly the same as a raw data record/line.

E. There will now be additional transaction types and additional transaction handling.

1) New transaction types: LI (ListAllById), QI (QueryById), DI (DeleteById). [DI is a dummy stub, like DN]. LI and QI handlers are in MainData class.

2) IN transactions will now need to call both InsertCountry (in NameIndex class) and InsertCountry (in MainData class).

3) LN (ListAllByName) and QN (QueryByName) transaction handlers (in NameIndex class) will have to call InputThisRecord (in MainData class), supplying the id found in the name index.

F. The actual MainData record will be displayed to the user (in Log file) for LI and QI transactions as well as for LN and QN transactions (via InputThisRecord).

PrepareRecForDisplay (in MainData class) nicely formats the fields into a nice string for UI's WriteThis.

G. An AutoTesterUtility program will be used to automate testing and the demo.

H. Name is now a 15-char string in nameIndex (truncated or space-filled on the right, as needed) since that's how it's stored in the MainData file

RawDataRecord class

This is a NEW class, added for A2. It contains storage for each individual field in the record (NOTE: you only need to specify those needed eventually in the MainData file - see below) It also contains the getters/setters to the necessary cleaning/converting of those fields (e.g., removing excess quote characters, generating id's, truncating/padding some strings to fixed size, converting some strings to integers/floats, etc.). This class provides a public method to ConvertRecToAppropFields which controls the processing of a single record (line) into the properly-configured individual fields.

SetupProgram can then use the appropriate getters (as parameters) when it calls the 2 InsertCountry methods (1st for mainData, 2nd
for nameIndex) - after it calls rawData (file)'s InputOneCountry method (which itself calls rawDataRecord's ConvertRecToAppropFields, supplying it with the wholeRecordAsABigString as a parameter).

Similarly, UserApp can call rawDataRecord.ConvertRecToAppropFields in the IN transaction handler (in the big switch statement) before calling the 2 InsertCountry methods.

Reference no: EM13609

Questions Cloud

Draw the project network : Determine the mean critical path for Brent's job search process. What is the variance of the project duration?
Create a application using the mvc architecture : create a application using the MVC architecture. No scripting elements are allowed in JSP pages.
Create a java program : UserApp and PrettyPrintUtility multiple times (supplying different TransData test file names), the AutoTesterUtility PROGRAM will be the driver program.
Calculate the maximum reduction in the standard deviation : Calculate the maximum reduction in the standard deviation
Putative analysis : Who gains from this story if it is accepted as "truthful information"?  Why do you believe your putative analysis?
Develop a marketing plan on a product or service : Develop a marketing plan on a product or service and describe Product applications in marketing, Role of Internet in marketing the product, Consumer profile, Naming the product, Conclusion.
Shift in the ad curve : The rising stock market implies an increase in wealth, at least as measured on paper. If we assume that some of this increased wealth gets consumed, then the rising stock market fuels an increase in aggregate demand, and may contribute to an inflatio..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Develop a reliable transfer protocol over udp

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Determine if strings are equal

Complete the recursive method match in the code below which will determine whether or not two strings match.

  Java program to create a tree

Java program to create a tree, generate class - BottomUpTwoThreeFourTree, BottomUpTwoThreeFourTree,

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

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