help a beginner please.

hi, so for a class im taking in c++ I have to program an application that will let you select your medication and then after you select it you can tell how many times you need to take it a day, and how many hours, or minutes you need to take it apart. Can you give me some basic ideas on how I would get started with this program, and how would I code the graphics? (im using devc++)
Were your previous thread of no use, or is your question somehow different?
Last edited on
I'm not sure what you would need graphics for, you could just write it to output to the terminal.
For your program, I would suggest starting out by creating a list of medications, and the instructions for them, and link them together somehow, maybe by using a data structure of some type, or a switch. Then it's just a simple matter of getting the input/output right.
There is always a way to use graphics (tough I have no idea what could be 3d here), but ciphermagi is right. You may find it easier to at first implement the program with console based io and only later move to graphics (not because console is somehow superior to graphics, but because you are more used to it).
Hi akakeighan,

I would use a map<string, vector<double> > to organise your data, with the string containing the names of your medication and the various elements of each corresponding vector<double> containing the days, hours, minutes, etc. between each dose. This will allow for efficient searching of the dosage according to a particular (string) key.

If your data base of medicines is unlikely to change, I would make it static and place it in a header file so that you only construct it once (since I take it, its likely to be large) when you return its data using some accessor function to create a template sentence filling in the name of the medicine (using the appropriate string) and the dosage (using the elements of the corresponding vector<double>).

As for graphics, yes the console should be sufficient, although you can of course make this part as complicated/elaborate as you like.

Good luck!
Ok, thanks for the ideas guys, I was wondering now, how would I per say run a certain code for all of my code, how would i get the timer code on my whole program?
1
2
3
4
5
6
vector<coder*> me;
vector<coder*>::iterator it;
vector *temp = new person();
me.push_back(temp);
it = me.begin();
cout << (*it)->personName << "doesn't know what you just said." << endl;
Last edited on
Topic archived. No new replies allowed.