Solved

C++ CLass organiser

Posted on 1998-04-29
5
215 Views
Last Modified: 2012-05-04
Has ANyone got source code for a C++ program that acts like an orgainser ?

I.e.  Edit Tasks, Add Tasks, Delete Tasks

and also uses priorities

Date of Task          Priority  Task
184/98                      2          Go Shoppig

The priority must be able to change when the date draws closer
so if it was the 17th today the priority would change to 1

If you see what i mean

Please help as this is very important to me

Thanks

RSVP
0
Comment
Question by:Stormclaw
  • 2
  • 2
5 Comments
 

Expert Comment

by:sankar012898
ID: 1166940

Ur  problem   can   be  solved   by  having  a  class  like  say  CTask
which   will  basically  store  details  like  date of  task , priority etc .
Derive this  class  from CObject class  of  MFC    and  use  COblist(comes with MFC)  class to  add  , delete  , edit  tasks . To add  an  object to COblist  , it should
be  derived from  CObject  .U  can  also  serialize  tasks  in to an  archive since  CTask
 is  derived   from  CObject.

0
 

Author Comment

by:Stormclaw
ID: 1166941
Whats MFC and COblist ?????

I have only learnt Basic C++ and I use the Compiler djgpp200 (DOS)

So can anyone enlighten me and is ther any source code out there for this prob


0
 

Expert Comment

by:anandkrish
ID: 1166942
If u can state clearly what is exactly is your requirment , I can help you design the class origanizer for you. So just state what is teh requirement and when exactly the priorities need to change etc.
0
 

Author Comment

by:Stormclaw
ID: 1166943
Okay

I need to create a class that

Edit Tasks, Add Tasks, Delete Tasks for the organiser program
and also uses priorities

The output must look like this

   Date of Task          Priority     Task
   184/98                      2          Go Shoppig

The priority must be able to change when the date draws closer
so if it was the 17th today the priority would change to 1

The priorities work on a 5 day basis, so 5 days to task Priority stays the same 4 days the priority increases by 1 and so on until there is only one day left before the task needs to be done.

Also the program needs to be able to save and load Lists of tasks.

The 2nd class must be a test class

If u have any ideas i would be very grateful
0
 

Accepted Solution

by:
anandkrish earned 100 total points
ID: 1166944
From what i undestood is that u need to do some thing like this
U need to use a template container class. The STL provides vector a standard template class for inserting and deleting objects.
A minor eg is given below. Go thru the documentation or i will give that to you.

The eg is using the association of vector to perform add delete etc. Depending on ur reqd this can also be retained of changed.

"The priorities work on a 5 day basis, so 5 days to task Priority stays the same 4 days the priority increases by 1 and so on until there is only one day left before the task needs to be done. "
This part is totally wierd. do u check for dates dynamically at runtime . During what event do u check for them. Unless the scope of this is clear we cannot activate the method that will handle such methods.

Your basic class that u need to dump into the collection class should have a string to accept the task , date for the date of execution and priority no. So such a class or struct should be used.

An eg as how design is

#include <iostream.h>
#include <vector>

template<class T>
class TargetOrganizer
{
      private vector<T> tasklist;
      void Add(T t)
      {
            //add the element to vector
      }
      void Delete(T t)
      {
            // delete from vector.
      }
      void Modify(T t)
      {
            // delete from vector
            // add from vector
      }
}

Give me more details and i will try to give better soln.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question