this is the error but i couldnt wat is wrong with it ,...
Code:
=======================================
(spaces,tabs and newlines do not matter)
*******************************************
* FILE NAMES DO MATTER *
* *
* SAME preview (as last night) *
* BUT gives 2 marks for each test *
* and some marks for some correct output *
* and tells you if filenames are incorrect*
******************************************
CHECKING FILENAMES
Testing Application
Program compiled
There are 4 tests each worth 1 mark
====== Test 1 Data File contains ========
192.149.089.061
100.001.004.031
034.056.078.012
192.149.089.061
100.001.004.031
192.149.089.061
111.022.033.004
192.149.089.061
111.022.033.004
111.022.033.004
============================
====== Test 1 Batch input to program contains ========
data1.txt
============================
** Passed test 1
====== Test 2 Data File contains ========
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
111.022.033.004
============================
====== Test 2 Batch input to program contains ========
data2.txt
============================
** Passed test 2
====== Test 3 Data File contains ========
192.149.089.061
100.001.004.031
034.056.078.012
192.149.089.061
100.001.004.031
192.149.089.061
111.022.033.004
192.149.089.061
111.022.033.004
111.022.033.004
============================
====== Test 3 Batch input to program contains ========
error.txt
error2.txt
error.txt
data3.txt
============================
** Passed test 3
====== Test 4 Data File contains ========
============================
====== Test 4 Batch input to program contains ========
data4.txt
============================
** Passed test 4
Testing Linking With Other Main programs
There are 4 tests
=================Main 1 contains =====================
#include <iostream>
#include <cstdlib>
using namespace std;
#include "IPlist.h"
int main()
{
IPlist ip;
if (ip.empty())
cout << "empty" << endl;
system("pause");
return EXIT_SUCCESS;
}
=======================================================
Program compiled
** Passed test 1
=================Main 2 contains =====================
#include <iostream>
#include <cstdlib>
using namespace std;
#include "IPlist.h"
int main()
{
IPlist ip;
string data[]={"a","b","c","a","b","c","a","d"};
// some strings to insert into IPlist for testing
// they don't really need to be IP addresses
for (int i = 0; i < 8; i++)
{
if (!ip.isPresent(data[i]))
ip.insertInOrder(data[i]);
else
ip.updateCount(data[i]);
}
ip.display();
cout << endl;
node *current = ip.find("d");
if (current != NULL)
cout << "found "<< current->IPaddress << endl;
system("pause");
return EXIT_SUCCESS;
}
=======================================================
Program compiled
** Half marks for test 2
** sample output **
IP address Count
a 3
b 2
c 2
d 1
found d
** your output **
IP address Count
a 3
b 2
c 2
d 1
found d
=================Main 3 contains =====================
#include <iostream>
#include <cstdlib>
using namespace std;
#include "IPlist.h"
void testCopyConstructor(IPlist x);
int main()
{
IPlist ip;
string data[]={"a","b","c","a","b","c","a","d"};
// some strings to insert into IPlist for testing
// they don't really need to be IP addresses
for (int i = 0; i < 8; i++)
{
if (!ip.isPresent(data[i]))
ip.insertInOrder(data[i]);
else
ip.updateCount(data[i]);
}
ip.display();
testCopyConstructor(ip);
ip.display(); // should be same as before
system("pause");
return EXIT_SUCCESS;
}
void testCopyConstructor(IPlist x)
{
// copy constructor will be automatically called when pass by value
// if we have written a correct copy constructor to make a deep copy
// then changing x will not change the corresponding argument
// (in this case ip in the main program)
x.insertInOrder("w");
x.insertInOrder("x");
}
=======================================================
Program compiled
** Half marks for test 3
** sample output **
IP address Count
a 3
b 2
c 2
d 1
IP address Count
a 3
b 2
c 2
d 1
** your output **
IP address Count
a 3
b 2
c 2
d 1
IP address Count
a 3
b 2
c 2
d 1
=================Main 4 contains =====================
#include <iostream>
#include <cstdlib>
using namespace std;
#include "IPlist.h"
int main()
{
IPlist ip;
string data[]={"a","b","c","a","b","c","a","d","xx","zz"};
// some strings to insert into IPlist for testing
// they don't really need to be IP addresses
for (int i = 0; i < 8; i++)
{
if (!ip.isPresent(data[i]))
ip.insertInOrder(data[i]);
else
ip.updateCount(data[i]);
}
ip.display();
cout << endl;
if (ip.empty())
cout << "PROBLEMS " << endl;
node *current;
for (int i = 0; i < 10; i++)
{
current = ip.find(data[i]);
if (current != NULL)
cout << "found "<< current->IPaddress << endl;
else
cout << "Not found" << endl;
}
system("pause");
return EXIT_SUCCESS;
}
=======================================================
Program compiled
** Half marks for test 4
** sample output **
IP address Count
a 3
b 2
c 2
d 1
found a
found b
found c
found a
found b
found c
found a
found d
Not found
Not found
** your output **
IP address Count
a 3
b 2
c 2
d 1
found a
found b
found c
found a
found b
found c
found a
found d
Not found
Not found