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

  Give at least one constructor without any parameter

We learned as popular Set implementation. Write own TreeSet class that implements following interface: You are to give at least one constructor without any parameter.

  How many numbers do you want to enter

Write a program that asks the user "How many numbers do you want to enter?" With that value, create an array that is big enough to hold that amount of numbers (integers).

  Calculate the vertical and horizontal components of u

Calculate the vertical and horizontal components of u (the launch velocity) using the following trigonometric identities:

  Write a recursive method to print all permutations of string

Write a recursive method to print all the permutations of a string. For instance, for a string abc, the printout is: abc acb bac bca cab cba

  Give an example of an exception

A. Give an example of an exception that could be generated outside your code but caught within your code

  Accesses element of array

Which of the following correctly accesses element 13 of array Book

  Constructor that initializes the three automatic properties

Create a class called Date that adds three pieces of information as automatic properties-a   month (type int), a day (type int) and a year (type int).

  Give the syntax of do while statement

Please complete the following short answer questions with code snippets as well as paragraphical responses. This assignment should not be an exercise in copy and paste, but an assessment of your comprehension and evaluation of the course materials..

  Create a javafx application named runningman.java

Create a JavaFX application named RunningMan.java to animate a man running laps. The man should run from left to right until the edge of the window is reached. The man should then begin running in the opposite direction.

  Class pointparameters

What is the output of the following Java program? Explain in terms of how parameters are passed in Java.import java.awt.*;class PointParameters

  What things are you struggling to understand

Discuss your experiences with the programming assignment - what things are you struggling to understand?

  Concept of java socket programming

Designed to asses learning outcomes and write programs that would communicate with another program running in the network

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