Your program should be able to automatically process all the 26 input data files (one file for each letter). Remember to delete the dynamic variables and close all the files as soon as they are not needed in your program. A summary of the processing should be output to the screen as shown in Figure
9
3456789 Aamna Ali
4567891 Adnan Khalid
1234567 Ahmed Salim
1234567 Ahmid Salim
3456789 Amna Ali
9876543 Amar Rashid
9876543 Ammar Rashid
9876543 Ammar rashed
9638527 Azzam Nasser
Figure 1: sample input file
Figure 3: sample run of the program.
4
1 3456789 Aamna Ali
1 1234567 Ahmed Salim
2 9876543 Amar Rashid
Figure 2: sample output file
I need help in this assigmnt in sorted list
# include "List.h"
List::List() {
for (int i=0;i<MAX_SIZE; i++)
data[i] = 0;
length = 0;
pos = -1;
}
bool List::isEmpty () const {
return length>0?true:false;
}
bool List::isFull () const {
return length==MAX_SIZE?true:false;
}
int List::getLength () const {
return length;
}
void List::insertItem(ItemType item) {
pos++;
data[pos] = item;
length ++;
}
void List::deleteItem (ItemType item) {
for (int i=0; i<length; i++) {
if (data[i] == item) {
if (length >1)
data[i] = data[length-1];
length--;
break;
}
}
}
void List::sort () {
// code this function
}
ItemType List::getNextItem () {
ItemType item;
// code this function
return item;
}
Place can you help what wrong???

New Topic/Question
Reply




MultiQuote





|