/ Published in: C++
Expand |
Embed | Plain Text
#include <iostream> #include "table2.h" #include "link2.h" using namespace std; //TEST FILE HAS TO INCLUDE FOLLOWING EXAMPLES // 1.Instantiate two Table objects and each with 10 fields. // 2.Display the two Table objects’ information. // 3.Use random number generator to generate 70 numbers each in between 0~200 for the Table objects. // 4.Display the two Table objects’ information. // 5.Removes all the data in first object. // 6.Display the two Table objects’ information. // 7.Using = to assign 2nd object to the first one. // 8.Display the two Table objects’ information. int main () { cout << "******** CHAINING HASH TABLE PROGRAMMING ********"<<endl; cout << "1.Instantiate two Table objects and each with 10 fields."<< endl; typedef int RecordType; Table<RecordType> test1; Table<RecordType> test2; Table<RecordType> empty; int i=0; // INSERT 10 NULLS while(i<10) { test1.insert('NULL'); } i=0; while(i<10) { test2.insert('NULL'); } i=0; // PRINT THEM while(i<10) { test1.print(i); cout << endl; } i=0; while(i<10) { test2.print(i); cout << endl; } i=0; test1 = empty; test2 = empty; cout << "1.Instantiate two Table objects and each with 10 fields."<< endl; return 0; }
You need to login to post a comment.
