Write a java class named algebra

Assignment Help JAVA Programming
Reference no: EM131267016

Consider the following "tilde table" that could be represented by the file cars.txt for persistence

MAKE~MODEL~TYPE~PRICE
Toyota~Camry~Sedan~18000
Toyota~Tacoma~Truck~19000
Ford~Mustang~Sport~21000
Chevrolet~Corvette~Sport~48000
Ford~F150~Truck~25000
Toyota~Highlander~SUV~35000

Since this is just for education purposes we will allow tilde tables to have the following attributes and limitations:
-at most 12 columns
-first row represents column names
-all columns are strings (unless you want to define some types)
-column values and column names are limited to 16 characters

Write a java class named Algebra that will eventually have static methods representing the relational algebra and one additional method which displays the contents of a tilde table. All methods except for the display method return a string indicating success or an error message and for every successful operation a new tilde table is produced on disk. For now implement the method to show the table, the project operation, the restrict operation, and one other of your choice from this list:

JOIN (assumes natural inner join), UNION, MINUS, INTERSECT, DIVIDE

So the main body of a driver program might look like this:

//restrict the cars table to toyotas producing a table named toyotas
Algebra.Restrict("cars","MAKE='Toyota'","toyotas");
//project just three columns from the toyotas table producing a table named answer
Algebra.Project("Toyotas","Make,Model,Price","answer");
//display the contents of the answer table
Algebra.Display("answer");

output would be:

MAKE            MODEL           PRICE

---------------- ---------------- ----------------

Toyota          Camry           18000

Toyota          Tacoma          19000

Toyota          Highlander      35000

Make your program generalizable. That is, it should work with any tilde table. Since the assumption for option 1 is that tables may not fit into memory you are not allowed to load all the rows into an array or other collection. You can of course load a list of column names or something small like that into memory. If you can think of a way to clean up the temporary results tables that would be good. In order to limit the grammar your restriction condition can be limited to a single condition (so no ANDs and ORs) and your comparitors can be limited to these six: =, >, <, >=, <=, !=

Reference no: EM131267016

Questions Cloud

Would you try to form teams of people who are all alike : In your opinion, is diversity within teams good or bad? Would you try to form teams of people who are all alike, or would you strive for a diverse mix of members? How does group composition, or diversity in the mix of members, affect group perform..
Write a memo to your employees and stakeholders : Task: As the CEO of your global organization, write a memo to your employees and stakeholders where you discuss the importance of using an ethical and respectful performance management system
Discuss the concept of supply chain integration : Discuss the concept of supply chain integration and explain why each of the six types of integration is important.
How your neighborhood is defined for marketers : Provide your ZIP code to see how your neighborhood is defined for marketers. Strategic Business Insights. (n.d.). The US VALS survey. Retrieved from http://www.strategicbusinessinsights.com/vals/presurvey.shtml
Write a java class named algebra : Write a java class named Algebra that will eventually have static methods representing the relational algebra and one additional method which displays the contents of a tilde table.
Explain the short-term and long-term implications of csr : Task: Drawing on the material in the background readings and doing additional research, please prepare a 3- to 4-page paper (not including the cover and reference pages) in which you: Explain the short-term and long-term implications of CSR
When would you prefer one approach over the other : Think about the differences between these approaches. When is one approach better than the other? When would you prefer one approach over the other? For this module's discussion, propose a research scenario that would be best completed by one meth..
What are the key processes in supply chain management : Identify the eight key processes of excellent supply chain management and discuss how each of these processes impacts the end customer.
Expected benefits that may come from supply chain mapping : Discuss the key strategic decisions supply chain managers must make when designing their companies' supply chains.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write an application in which the user can enter a date

Write an application in which the user can enter a date using digits and slashes (for example, " 6/24/2012 " ), and receive output that displays the date with the month shown as a word

  Java application to declare and create a vector

Write a java application that perform the following task: declare and create a vector with initial size of 10, increment of 2

  Implement elliptic curve encryption - decryption in java

Implement Elliptic Curve encryption - decryption in java. Specifically, your program will read parameters, plaintext and ciphertextfrom a file

  Java program for real estate agent

Write down java program for real estate agent. Program must perform the following tasks: ask users for average house price for the each of past 5 years for single family residence of 1500 square feet.

  Write the entry or record into a sequential file

Develop a Java based GUI application(using swing) that allows the user to enter Charity/Fund information: Write the entry/record into a sequential file

  Create the default junit tests using netbeans

Create the 'default' JUnit tests using NetBeans. Do this for the HomeAppliance class only; not for your JFrame GUI class.

  A regular polygon is an n-sided polygon

A regular polygon is an n-sided polygon in which all sides are of the same length and all angles have the same degree(i.e the polygon is both equilateral and equiangular).

  Design an interface interactive game

First, design an interface InteractiveGame that generalizes the playing of any two-person game between a human player and the computer. Design two actual games, Nim and another game of your choice, except TicTacToe, that implement your Interactive..

  Modify the factorial method with a recursive call

You may want to add such display capabilities to other recursion examples and exercises throughout the text.

  Swing gui program to make the applet

Each button under Yes or No, when clicked, would respond with a corresponding statement printed in the South border to say

  Create an application that will allow a new customer

Create an application that will allow a new customer to order a house. You'll allow the customer to choose among four models (Aspen, Britattany, Colonial, and Dartmoor) by creating separate ButtonGroups.

  Add a draw() method to horse class.

Add a draw() method to your Horse class. You will also need to create a couple of Horses in your DrawPanel class, and call the draw() method for each Horse from the paintComponent() method. There is no need to modify the DrawPanelDriver class.

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