Lab-07 Sorted List Array
Lab-07 Sorted List Array
Lab 07
Sorted List (array based)
In today’s lab we will design and implement the List ADT where the items in the list are sorted.
Solution:
1)TimeStamp.h
2)TimeStamp.cpp
3)main.cpp
Inlude the template datatypes explicitly at the end of Sortedtype.cpp. Also include the TimeStamp.h
header file in your SortedType.cpp source file.
class timeStamp {
private:
int seconds;
int minutes;
int hours;
public:
// Default constructor (doesn't take any parameters)
timeStamp();
#endif // TIMESTAMP_H
#include <iostream>
#include "TimeStamp.h"
// Getters
int timeStamp::getSeconds() {
return seconds;
}
int timeStamp::getMinutes() {
return minutes;
}
int timeStamp::getHours() {
return hours;
}
int main() {
// Create a SortedType list of integers
SortedType<int> intList;
cout<<endl;
cout <<"========================================================" <<endl;
cout<<" timeStamp class implementation starts from here "<<endl;
cout <<"========================================================" <<endl;
cout<<endl;
SortedType<timeStamp> timeList;
return 0;
}