Solved

C++ CLass organiser

Posted on 1998-04-29
5
212 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now