Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Prepare WorldDataApp project. It implements the NameIndex portion, including:

• creating it (implemented as a Binary Search Tree (BST)) in SetupProgram, and
• searching, viewing and updating it in UserApp program.

A third program, PrettyPrintUtility, displays the backup index file so the developer (and grader) can easily view the file in a nicely-aligned printout. NameIndex is created as an internal data structure - so in order to "move it" from one program execution to another (i.e., from SetupProgram to UserApp, and from UserApp today to UserApp tomorrow), it is saved and re-loaded to/from a backup file.

So there are 3 physically separate programs, all within a SINGLE Java/C# project:

1. SetupProgram - creates the internal NameIndex based on data in the RawData file - and saves it to the Backup file

2. UserApp - loads the NameIndex from the Backup file, then processes the transactions in Trans file, sending output to the Log file, then saves the index to the Backup file

3. PrettyPrintUtility - reads/prints the Backup file to the Log file

There are 4 data files used in the project:

1. RawDataTester.csv (input to SetupProgram - I'll provide this file)

2. NameIndexBackup.txt (output from SetupProgram, input/output for UserApp and input to PrettyPrintUtility)

3. Log.txt (all 3 programs output to this file)

4. TransData.txt (input to UserApp - I'll provide this file)

Batch processing (vs. interactive processing) is used to facilitate testing and the capture of the programs' executions for submission for grading. That is, all 3 programs write to the Log file, and user transaction requests to UserApp come from the TransData file - rather than the console or a Windows or Web form.

Object Oriented Programming (OOP paradigm) must be used for SetupProgram and UserApp programs. But since it's just a quickie developer-utility program, PrettyPrintUtility just uses the traditional Procedural Paradigm (PP) approach.

So there are 3 classes (besides the 3 main programs):

1. RawData handles all file/record/field handling for the RawData file. It's only used by SetupProgram.

2. NameIndex handles everything to do with the internal name index and its backup file.

This class is used by both SetupProgram and UserApp.

3. UserInterface handles everything to do with batch processing including anything to do with the Log file and the TransData file. This class is used by both SetupProgram (for Logging) and UserApp (for getting TransData and for Logging).

A program is a physically separate chunk of code in its own .java (or .cs) file that contains its own main (or Main) method as the execution starting point. It is independently compile-able and independently executable.

So SetupProgram, UserApp and PrettyPrintUtility can each be run individually by the developer completely on their own. The programs must, of course, be run in the correct order - i.e., SetupProgram must be run before UserApp or PrettyPrintUtility.

OOP - Information hiding

The 3 class NAMES and the PUBLIC METHODS each describe WHAT the object is and its functionality to the "outside world", WITHOUT specifying HOW the underlying storage or interaction will be implemented. The code in the 2 actual programs which use the 3 classes are NOT at all aware of:

WHERE the RawData field values come from (A data file? Interactive users? A database? A bar-code scanner?) nor HOW it was derived (Any transformations? Record-splitting into fields? Field editing after reading from text-boxes? Floats changed to integers? Metric changed to imperial measures? Field-values calculated or read-in from storage?)
HOW the NameIndex data is stored/accessed (a BST? An ordered list? A hash table?) nor whether it's an internal or external structure or even an actual database or the cloud
HOW the UserInterface is implemented (Batch processing? Interactive using the Console? A Windows or Web front end?)

This makes OOP programs easy to change since all code changes are done within the class, with no changes to the main program code (e.g., batch input/output can be changed to a web app by altering the code in UserInterface - NameIndex could be changed to use an external HashFile rather than an internal BST - RawData could be read from a database rather than a data file).

Java, Programming

  • Category:- Java
  • Reference No.:- M9716407
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

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 ...

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 ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

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 ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

  • 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