Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M9716331
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Java

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As