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 a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  How can you use a hash function to find duplicate files

How can you use a hash function to find duplicate files (even when the file name is changed)?

  A client or server prepare to use udp in a java application

How does a client or server prepare to use UDP in a Java application? Are there any differences in what the client does and what the server does?

  Create an application that keeps tracks of the information

Create an application that keeps tracks of the information in such a simple social network. More specifically, your application will allow for user profiles to be added to, deleted from, or looked-up in the social network.

  Test plan outline a test plan for a substantial real-life

test plan outline a test plan for a substantial real-life system of your choosing. some possible examplesbullbaggage

  What vulnerabilities might these threats exploit

What special consequences do you foresee from information security breaches confined to online retail banking compared to online commercial banking?

  Design an adt for the problem

Design an ADT for this problem. Be sure to consider all necessary operations to maintain the appointment book for one year, to archive the yearly book and create a new book for the following year.

  Instantiate a circle by giving its radius and use

Write a class Circle.java from which we can instantiate a circle by giving its radius and use it as is shown in the following program. 1 import java.util.Scanner; 2 public class Circles {

  Design a java application that will read a file containing

Design a Java application that will read a file containing data

  Write java program to read present basic hourly wage

Write down a java program which will input 1. Read present basic hourly wage. Read in workers fist name and socond name.

  Display a list of entries in a jtextarea or jtable

Create a GUI-based program to accept name of donor, name of charity, and amount of pledge from the user. Display a list of entries in a JTextArea or JTable

  Write a java program that finds the temperature

Write a JAVA program that finds the temperature that is the same in both Celsius and Fahrenheit.

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