Task Manager? C++ Help!

Basically my program is supposed to be a "Task Manager". My program runs correctly, however, I think I am messing up with the "Design Considerations" and the "guidelines". If anyone can lend some help and explain to me what I am messing up that would be awesome!

My teacher said this about my code. "The document asks you to model data for Task entry and you have address entry. Your struct does not match the specifications in the lab3 document. The address entry struct was the sample provided for you to understand how to model any other similar class."

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Write an interactive text based menu interface (using a loop) that will allow the user to 
•	Enter a task or assignment
•	Display all of the tasks that are in the file
•	Find a task by Course 
•	Quit
For each task, you need to keep track of:
•	Course Name that it is for (e.g., CS162)
•	Description of the assignment (e.g., Finish Lab 2)
•	Due date (e.g., 9/26/2009) 


Design Considerations (Please read carefully and thoroughly):
Please follow the specifications below and do not deviate from them.  Failure to follow the specifications will result in deduction of points.
1.	Name your file lab3.cpp.  If there are multiple files, name them appropriately and name your main file lab3.cpp.
2.	Please be sure the source file includes your name, assignment description and number, and date, as a program comment!
3.	Write at least four functions WITH arguments for this assignment.
4.	Use structs or class named Task to model task. You are encouraged in every way to use class to model task in this lab. If you do the work here, you will benefit from this in Lab 4 and 5. 
5.	You MUST use class named TaskList to model the collection of tasks. 
6.	You MUST use array of Task to implement the above class, TaskList.
7.	When using class, please make sure you encapsulate the data, which means make all the instance data members private and provide accessor methods and mutator methods to access and manipulate the data. 
8.	Hint: In this assignment, the description and course name may have multiple words in it. Therefore, you now SHOULD read using the 3 argument version of get. 
9.	Watch out. When using the 3 argument version of get you need to make sure to remove the delimiter or newline. Therefore, anytime you read (even a confirmation message), make sure to eat the newline!
10.	Make sure to have a delimiter written between each item in the file – like a newline. This will be important when you read the information back from the file. 
11.	Your txt file must have at least 3 line items when you submit it.


My program...Keep in mind this is before I split the program into separate ".h" files.  

[code]
#include <iostream>                 
#include <string>    
#include <cctype>
#include <iomanip>
#include <fstream>

using namespace std;     

const int MAX_CHAR = 101;
const int NAME_COL_WIDTH = 30;
const int DATE_COL_WIDTH = 40;
const int ADDRESS_BOOK_CAPACITY = 100;

class TaskEntry
{
public:

	char	name[MAX_CHAR];
	char	duedate[MAX_CHAR];
}; 

#include "DisplayFunctions.h"

int main ()
{
	char			command;
	TaskEntry	list[ADDRESS_BOOK_CAPACITY];
	int				listSize = 0;
	char			fileName[] = "tasks.txt";
	
	loadAddressBook(fileName, list, listSize);	

	displayMenu();
	command = readInCommand();
	while (command != 'q')
	{
		processCommand(command, list, listSize);
		displayMenu();
		command = readInCommand();
	}

	saveAddressBook(fileName, list, listSize);	
    
    return 0;
}

#include "ReadString.h"

#include "DisplayMenu.h"

#include "ReadCommand.h"

#include "ProcessCommand.h"
	
#include "ReadEntry.h"

#include "ReadName.h"

#include "DisplayAll.h"

#include "AddEntry.h"

#include "SearchEntry.h"

#include "LoadBook.h"

#include "SaveBook.h" 
Last edited on
These are the "guidelines"...

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
Requirements
Incorporate the use of C++ classes in your design. 

Write an interactive text based menu interface (using a loop) that will allow the user to 
•	Enter a task or assignment
•	Display all of the tasks that are in the file
•	Find a task by Course 
•	Quit
For each task, you need to keep track of:
•	Course Name that it is for (e.g., CS162)
•	Description of the assignment (e.g., Finish Lab 2)
•	Due date (e.g., 9/26/2009) 
Allow the program to keep looping until user wants to quit. When the program starts, it should load the tasks from external file ("tasks.txt") into memory. When user enters the three items of a task, the program needs to read them in, save them in memory and eventually write them to the external data file ("tasks.txt"). The file format could look like: (The ';' is used as a delimiter or field separator.)  Please read the Design Considerations section on next page.
CS162;Finish Lab 2;9/26/2009
CS201;Take Quiz 1;9/28/2009 

Design Considerations (Please read carefully and thoroughly):
Please follow the specifications below and do not deviate from them.  Failure to follow the specifications will result in deduction of points.
1.	Name your file lab3.cpp.  If there are multiple files, name them appropriately and name your main file lab3.cpp.
2.	Please be sure the source file includes your name, assignment description and number, and date, as a program comment!
3.	Write at least four functions WITH arguments for this assignment.
4.	Use structs or class named Task to model task. You are encouraged in every way to use class to model task in this lab. If you do the work here, you will benefit from this in Lab 4 and 5. 
5.	You MUST use class named TaskList to model the collection of tasks. 
6.	You MUST use array of Task to implement the above class, TaskList.
7.	When using class, please make sure you encapsulate the data, which means make all the instance data members private and provide accessor methods and mutator methods to access and manipulate the data. 
8.	Hint: In this assignment, the description and course name may have multiple words in it. Therefore, you now SHOULD read using the 3 argument version of get. 
9.	Watch out. When using the 3 argument version of get you need to make sure to remove the delimiter or newline. Therefore, anytime you read (even a confirmation message), make sure to eat the newline!
10.	Make sure to have a delimiter written between each item in the file – like a newline. This will be important when you read the information back from the file. 
11.	Your txt file must have at least 3 line items when you submit it.
Do-Not List for All Labs in CS162: 
•	No Global Variables (you can have global constants)
•	No use of the stdio library (use iostream and fstream)
•	Instead of the string class, you will be using arrays of characters and the cstring library
•	No goto statements.
Requirement #4. You were strongly encouraged to use a class rather than a struct. Where does this assignment say anything about email addresses? I would grade this very harshly for not using a class and using a struct that has no relation to the assignment.

Line 155: Prompting for "Due date" and reading it into email? Seriously?

Requirement #5. I see no class TaskList in your program. Requirement states your MUST ust class TaskList. This would be a fail.

Line 183: Your search makes no sense. What are you storing in TaskEntry.name? Course name? Task name? Why are you comparing email (which really contains due date)?

zerosniper123 wrote:
If anyone can lend some help and explain to me what I am messing up that would be awesome!

Failure to read.

Requirement:
For each task, you need to keep track of:
•	Course Name that it is for (e.g., CS162)
•	Description of the assignment (e.g., Finish Lab 2)
•	Due date (e.g., 9/26/2009) 


Your code:
1
2
3
4
5
struct TaskEntry
{
	char	name[MAX_CHAR];
	char	email[MAX_CHAR];
}; 
Last edited on
Okay I figured out I posted the un-edited program I had. This one is the updated version. This one I have separate ".h" files. My main program is the first bit of code. It runs, however I don't know if I am still following all the rules.

I changed my program in the "FIRST POST".
Last edited on
You haven't posted the individual header files, so it's hard to say. It appears all you have done is put the function declaration for each function in a separate file.
Where is the code for those functions?

You class declaration at line 43 violates requirement #7 (use encapsulation).

Still don't see any reference to class TaskList (requirement #5).

Okay I changed the first bit of code so I had a reference to "TaskList". However, I am having a problem solving how to use manipulators so my "void" functions can access the "name" and "duedata" information.

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
#include <iostream>                 
#include <string>    
#include <cctype>
#include <iomanip>
#include <fstream>

using namespace std;     

const int MAX_CHAR = 101;
const int NAME_COL_WIDTH = 30;
const int DATE_COL_WIDTH = 40;
const int ADDRESS_BOOK_CAPACITY = 100;

class TaskList
{
public:

	char	name[MAX_CHAR];
	char	duedate[MAX_CHAR];


}; 

#include "DisplayFunctions.h"

int main ()
{
	char			command;
	TaskList	list[ADDRESS_BOOK_CAPACITY];
	int				listSize = 0;
	char			fileName[] = "tasks.txt";
	
	loadAddressBook(fileName, list, listSize);	

	displayMenu();
	command = readInCommand();
	while (command != 'q')
	{
		processCommand(command, list, listSize);
		displayMenu();
		command = readInCommand();
	}

	saveAddressBook(fileName, list, listSize);	
    
    return 0;
}
All you did was change the name of TaskEntry to TaskList. Requirements 4 and 5 are separate requirements. Now you're not meeting requirement 4.

You're still violating requirement #7.

I am having a problem solving how to use manipulators so my "void" functions can access the "name" and "duedata" information.

I see no void functions in what you've posted, so I can't make any suggestion.



Topic archived. No new replies allowed.