Opinion On Where To Start
I JUST WANT AN OPINION ON WHERE SHOULD I START ATTACKING THIS PROJECT FROM, AS IN WANT KIND OF THINGS AM I GOING TO USE FOR IT:
For these two labs you are going to construct functionality to create a simple address book. Conceptually the address book uses a structure to hold information about a person and an array of structures to hold multiple persons (people).
Visually think of the address book like so:
When you add a person to the Address Book you add a structure with the information about the person to the end of the array:
When you get a person, you get the first person in the address book. With each successive call to get a person, you get the next person in the array. For instance the first call to get a person you will get "Joe Smith" when you make the second call to get a person you would get "Jane Doe" so on and so forth. After you get the last person from the array the next call to get a person will start over at the beginning ("Joe Smith" in this case).
Details:
1.) Create a project called addressBook
2.) Add a header file and cpp file for your project
3.) All of your definitions should go in the header file.
4.) In the header file create the definition for your structure. Call it PERSON.
5.) Your structure should have fields for first name, last name, address, and optionally a phone number.
6.) Inside the cpp file you will create the functionality for your address book
7.) Inside the cpp file declare a global array of 10 PERSONS to hold all of the records in your address book call it people. Use a const called MAXPEOPLE to set the size of the array. Put the const in the header file.
8.) You are probably going to want to declare an integer variable to keep track of where you are at in the array.
9.) Create functions addPerson, getPerson
10.) These functions should take as arguments a reference to a PERSON structure.
11.) The addPerson method should copy the structure passed to it to the end of the array
12.) the getPerson should start at array element 0 and with each successive call return the next person in the array.
13.) Create overloaded findPerson functions. One function should take only the persons last name
14.) The other function should take both the persons last and first names.
15.) All code for the functions should be in the cpp file
16.) From main write functionality that will test your address book code
All of the functions that are part of the address book should take a reference to a PERSON structure as one of its arguments. This is not necessarily the only argument for each function but should be one of them.
The code here is really not all that tricky but it is going to take some thought.
[2821 byte] By [
Mrgoofhead] at [2007-11-20 11:18:24]

# 1 Re: Opinion On Where To Start
It looks like you'll be using structures ('struct'), arrays, and some functions to break up the work.
Viggy
# 2 Re: Opinion On Where To Start
Ok that help, thanks viggy, still open for more suggestions. =)
# 3 Re: Opinion On Where To Start
Details:
1.) Create a project called addressBook
2.) Add a header file and cpp file for your project
3.) All of your definitions should go in the header file.
4.) In the header file create the definition for your structure. Call it PERSON.
5.) Your structure should have fields for first name, last name, address, and optionally a phone number.
6.) Inside the cpp file you will create the functionality for your address book
7.) Inside the cpp file declare a global array of 10 PERSONS to hold all of the records in your address book call it people. Use a const called MAXPEOPLE to set the size of the array. Put the const in the header file.
8.) You are probably going to want to declare an integer variable to keep track of where you are at in the array.
9.) Create functions addPerson, getPerson
10.) These functions should take as arguments a reference to a PERSON structure.
11.) The addPerson method should copy the structure passed to it to the end of the array
12.) the getPerson should start at array element 0 and with each successive call return the next person in the array.
13.) Create overloaded findPerson functions. One function should take only the persons last name
14.) The other function should take both the persons last and first names.
15.) All code for the functions should be in the cpp file
16.) From main write functionality that will test your address book code
That is a pretty detailed list of what you will need to write. I would start off by making the structure and setting up the variables that it should contain. Then add the functions that it says it needs to have. The best way to find out how to do something is to just try. If you dont understand how to do something, like setting up the structure, we can advise you.
# 4 Re: Opinion On Where To Start
Ok that help, thanks viggy, still open for more suggestions. =)
I'd start at step 1. You've got very detailed instructions there. What are you stuck on specifically?
GCDEF at 2007-11-10 22:29:04 >

# 5 Re: Opinion On Where To Start
Hey Mrgoofhead,
In case you didn't get the hints all along, there's an FAQ somewhere around here on the subject of doing homework.
The summary point there is we're not one of those services that starts, builds and completes homework - and you'd be surprised how many threads seem to be launched expecting just that. Personally, I'd charge for that. Somewhere around $200, but even taking that money and providing the project is morally vacant. Like selling thesis papers. (And I know a double PhD, who can't hold a job, that does that).
On the other hand, students (even pro's, the 'new' ones mostly) have a problem with the blank page. Its the same for musicians, writers, poets, the odd book report; the blank page is a terrible starting point. It's like the nanosecond after the big bang. Anything could happen. 100% potential, zero % expression.
Unfortunately, by the time you get a project like that - that's the point of the exercise. There's a list that gives you the outline of the starting point. It's actually fairly good. Without actually handing you code, its as good as it gets.
In my career I've had to take the proverbial napkin sketch, literally written over lunch, and turn that into a product for use by a temporary 'clerical' staff of 750, hired for a week long project that took written data and churned that into 50,000 pages of detail (a printed report), summarized into 1,200 pages and sorted/sifted/searched for nearly a year afterwards.
I got the contract at lunch on Monday. The staff was expected to arrive, ready to turn hand written forms into data by Wednesday morning. The technological 'era' was 1987. The '386 was about to be released, but I didn't have one.
What I had was a room full of IBM AT machines, with 'daughter' CPU cards (2 each) based on the 8086, each with 8 RS-232 ports (16 workstations per AT computer), and network storage devices offering a whopping half gigabyte of storage (really big in those days), 800 'dumb terminals' (Wyse), a technical staff of 30, 3 spacious empty floors suitably air conditioned for 850 people (managers, the hired clerical staff, my technical crew, the odd visiting VP, etc).
I also had what you now face. A blank page (and perhaps a blank stare for the first 5 minutes).
I had to design the database, write the front end (the UI that takes the data from somewhat trained data entry staff), trust that it would take a few days for the clerical staff to produce the data while I prepared the reports and research services (SQL was barely new at that point, and none of the 'interested' researches would understand how to query a database).
For an experienced pro, that's not that tough, really. There were, if I recall, 6 or 7 different 'forms' of data, roughly relating to 9 or 10 tables in SQL. There were a few 'finessed' relations in the UI (things like coded selections, radio button stuff) - but no Windows GUI - this was character based 'old school' stuff. Higher, cheaper-tech 'micro' versions of the 1970's 'data processing' stuff.
My point is this. You've got to start something yourself. If you can't, you really are asking for a cheat here. We are actually not helping you if we did that. If you can't do it, you're in over your head and either need to focus your attention (this is, after all, a mental performance task), or determine that this isn't 'your' subject after all.
JVene at 2007-11-10 22:30:03 >

# 6 Re: Opinion On Where To Start
Just to add JVene's reply...
Visual C++ General: Can you help me with my homework assignment? (http://www.dev-archive.com/forum/showthread.php?t=366302)
How To Ask Questions The Smart Way (http://www.catb.org/~esr/faqs/smart-questions.html)
and please don't use caps, its rude.
Ejaz at 2007-11-10 22:31:08 >

# 7 Re: Opinion On Where To Start
Personally, I'd charge for that. Somewhere around $200, but even taking that money and providing the project is morally vacant.
Yeah, Id Do It GUI For $200.00, Or Console For $50.00 ...LOL...
# 8 Re: Opinion On Where To Start
Except, not on *this* forum. ;)
# 9 Re: Opinion On Where To Start
Except, not on *this* forum.
I Would Never Step On Brad's Toes Like That.