-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList.h
More file actions
50 lines (45 loc) · 806 Bytes
/
List.h
File metadata and controls
50 lines (45 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef LIST_H
#define LIST_H
#include <iostream>
using std::cout;
using std::endl;
#include <string>
#include "Task.h"
//Inner type listnode class
class ListNode
{
public :
//ListNode constructor
ListNode(const Task &ta);
//returns task
Task getTask() const;
private:
//real task
Task content;
//next pointer
ListNode *next;
friend class List;
};
//list of tasks
class List
{
public:
//constructor
List();
//destructor
~List();
//returns total cost
int getbill();
//inserts new task
void insert(const string &fa, const int, const int);
//printer
void print() const;
//only prints first task
void printfirst() const;
private:
//first node in task
ListNode *first;
//total cost
int bill;
};
#endif