Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C++ CLass organiser

Posted on 1998-04-29
5
Medium Priority
?
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

715 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