assign1(中文)(7)
发布时间:2021-06-06
发布时间:2021-06-06
作业c++项目
void Add(Person & element);
Person & NextElement()const;
Person & RemoveElement();
Person & RemoveElement( int index );
int Size() const;
void Print() const;
private:
Person ** _elements;
int _capacity; //volume of the set
int _size; //number of elements in the set
int _index;
};
R3.3) 在任何地方的const及const类里放置const的标识符,都应该有const修饰符.
2. 测试要求
第四部分) 测试规格
R4.1)
在完成了你的类之后,你应该可以在执行下面的主程序
//file main.cpp
#include <iostream>
#include <string.h>
#include "Date.h"
#include "Person.h"
#include " PersonSet.h"
using namespace std;
int main()
{
//declare some const persons
Person *p1 = new Person("Lou", "lou@chat.ca", 20, 6, 1960);
Person *p2 = new Person("Frank", "f123@chat.ca", 20, 3, 1967);
Person *p3 = new Person("Ann", "ann@chat.ca", 20, 8, 1960);
PersonSet boys, girls;
boys.Add( *p1);