Write a java class named algebra

Assignment Help JAVA Programming
Reference no: EM131308263

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");

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: EM131308263

Create a graphical application stackdemogui

Create a graphical application StackDemoGUI that provides a button for push and pop from a stack, a text field to accept a string as input for push, and a text area to show

Draw a uml diagram of each of the shapes

Draw a UML diagram of each of the Shapes, Rectangle and Square classes using the code that has been provided. Complete this using the examples that have been provide in the

Write java program to accept two words as input

Write a Java program that accepts two words as input and determines if one of them is resulting from changing the order of the others' letters.

Sample run of the program to illustrates the expected outpu

Write a program WordCount.java that takes contents of a file and list the five most frequently used words in it.Your program should prompt user for a filename and - assuming t

Generate and display the polynomial

Design and write the methods calculate Brute Force and calculate Horner for calculating the polynomial value for an integer value of x by using the brute force approach and

Program produces 1000 integer ranging

Then your program produces 1000 integer ranging from 1to 10000 in the array and then sort them in ascending order and then print the result into data.txt file. (You may list

Write an interface for a bagadt that implements iterable

Write an interface for a BagADT that implements the Iterable interface. Include javadoc comments that will generate specifications for the BagADT so that someone who wants

Write an enhanced for loop that iterates over each student

Calculates the tuition for each student. Write an enhanced for loop that iterates over each Student in. pStudentList. For each Student, call calcTuition() on that Student. Not

Reviews

Write a Review

 
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