Solved

C++ CLass organiser

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

708 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

13 Experts available now in Live!

Get 1:1 Help Now