求教三个类的写法

creepyOne 2013-06-26 10:04:00
已完成
#ifndef LINKEDLIST_H
#define LINKEDLIST_H

#include <iostream>
using std::cout;
using std::cin;
using std::endl;


template < class Type >
class LinkedList
{
public:
LinkedList();
~LinkedList();

void insert(const Type &item, int);
void remove();
Type retrieve() const;
int gotoPrior();
int gotoNext();
int gotoBeginning();
void clear();
int empty() const;

LinkedList(const LinkedList &src);

protected:
class ListElement
{
public:
ListElement(const Type &item, ListElement* nextP):
element(item), next(nextP) {}
Type element;
ListElement* next;
};
ListElement *head;
ListElement *cursor;
};

#endif



#ifndef MEMO_H
#define MEMO_H
class Memo
{
public:
Memo();
const char * getTime();
const char * getTitle();
void setTime(const char *stime);
void setTitle(const char *stitle);
int getKey();
private:
char time[6];
char title[41];
};
#endif



#ifndef ORDLIST_H
#define ORDLIST_H
#include "linkedlist.cpp"
template <class Type, class Key>
class OrdList : public LinkedList<Type>//Inheritance
{
public:
OrdList();
~OrdList();
void insert(Type& item);
void merge(const OrdList<Type,Key> other_list);
int search(Key search_key);
};

#endif



#ifndef SCHEDULER_H
#define SCHEDULER_H
#include "Memo.h"
#include "OrdList.cpp"

class Scheduler
{
public:
Scheduler();
void copyConstTest();
void insertMemo(Memo newMemo);
void deleteMemo(char *time);
void readMemos(char filename[]);
void writeMemos(char filename[]);
void displayMemos();
void mergeMemos(char filename[]);
void clearMemos();

private:
OrdList<Memo, int> memos;
};
#endif

#ifndef INTERFACE_H
#define INTERFACE_H

#include "Scheduler.h"

class Interface
{
public:
Interface ();
void getCommand ();
void executeCommand ();
int done ();//返回finished值

private:
Scheduler scheduler;
char command;
int finished;
};

#endif


要求从屏幕或者从文档读取时间安排存入ordlist然后由interface作为一个中控
...全文
104 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
creepyOne 2013-06-26
  • 打赏
  • 举报
回复
顶起求助 不需要实现只需要逻辑和一些实例参考就给分的
creepyOne 2013-06-26
  • 打赏
  • 举报
回复
引用 1 楼 Loaden 的回复:
你不是会坐等别人给你写实现吧?
子类的实现是的确不怎么明白 另外两个类是完全没有头绪 讲一下逻辑也会给分的
老邓 2013-06-26
  • 打赏
  • 举报
回复
你不是会坐等别人给你写实现吧?

64,682

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧