Solved

C++ CLass organiser

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixing C++ & C# in Vis Studio 2013 7 280
FMX StringGrid1->Canvas->FillRect Problem 3 221
Problem with SqlConnection 4 193
show out valin of json for debugging in visaul c++ 1 54
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

739 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