473,327 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

About data-storing problem....

Sorry to disturb. I'm truly a beginner in C++ and my knowledge of it is
really not much. I've been facing a serious problem during these few
days. Let me describe my situation as clearly as I can and I do hope
you guys can give me a helping hand.

Suppose I have a number of people's personal information such as name,
age, hobbies, etc. How can I store them in a way that can be easily
amended by each person? How can I group the people with the same age
group or the same hobby together? And how can I use the data?

There're still a lot of questions but I will raise them later.

Every reponse worths ten tons of thank-you.

Aug 12 '05 #1
6 1294
cl************@yahoo.com.hk wrote:
Sorry to disturb. I'm truly a beginner in C++ and my knowledge of it is
really not much. I've been facing a serious problem during these few
days. Let me describe my situation as clearly as I can and I do hope
you guys can give me a helping hand.

Suppose I have a number of people's personal information such as name,
age, hobbies, etc. How can I store them in a way that can be easily
amended by each person? How can I group the people with the same age
group or the same hobby together? And how can I use the data?

There're still a lot of questions but I will raise them later.

Every reponse worths ten tons of thank-you.


Well, you'd probably want to store the people's information inside a
container holding all the information for one person, and then store
each persons information inside a container of all people's
information. Grouping could be done through built-in or custom
algorithms as needed.

You can use the data in whatever way you want. It is C++, so the limits
are practically boundless. What is your end goal for this application
that you are developing?

Josh McFarlane

Aug 12 '05 #2

<cl************@yahoo.com.hk> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Sorry to disturb. I'm truly a beginner in C++ and my knowledge of it is
really not much. I've been facing a serious problem during these few
days. Let me describe my situation as clearly as I can and I do hope
you guys can give me a helping hand.

Suppose I have a number of people's personal information such as name,
age, hobbies, etc. How can I store them in a way that can be easily
amended by each person?
What do you mean "amended by each person"? Are you talking about some kind
of database with login and security features? That's a task far beyond a
beginning programmer.
How can I group the people with the same age
group or the same hobby together? And how can I use the data?

That depends on how you've stored the data. Which depends on what you're
trying to do. The design could be as simple as a class with member data, or
as complex as a relational database back end with a login-protected,
client-server front end.
There're still a lot of questions but I will raise them later.


I think there's a lot of questions to be answered first.

Are you looking for design assistance? Or basic programming assistance?

If you're really a beginner, then you need to work with some good books on
the subject, and taking some courses wouldn't hurt. Courses will provide
you with ample opportunity to try out simple programs which demonstrate the
basics.

If you need helpp designing some kind of specific system, then you really
need to be more specific as to to what you're trying to do, and what part
you have a problem with.

-Howard

Aug 12 '05 #3
To Josh:

Thank you for helping me again.

But I am still not quite understand what "store the people's
information inside a container holding all the information for one
person, and then store each persons information inside a container of
all people's information." means. And more importantly, how can I
achieve what you've said?

-David Griffiths

Aug 13 '05 #4
To Howard:

Thank you for helping me again.
Are you talking about some kind of database with login and security features?
Exactly.
or as complex as a relational database back end with a login-protected, client-server front end.

Exactly.
Are you looking for design assistance? Or basic programming assistance?
Actually, both. How can I start coding without any design?
If you're really a beginner, then you need to work with some good books on the subject, and taking some courses wouldn't hurt.

I am a true beginner who've just learnt something like array,
differnet method of sorting data in an array, or this kinds of really
simple things at school.
If you need helpp designing some kind of specific system, then you really

need to be more specific as to to what you're trying to do, and what
part
you have a problem with.

Actually, I am required to write a "seating-plan program".
Firstly, I need to collect and store all information of the applicants.
Secondly, I need to allocate them to different table but there're
several allocation rules such as grouping people with the same age
group or the same hobby. And also, the applicants should be able to
amend their submitted information easily. That's all my goal. Hope you
can help me.

-David Griffiths

Aug 13 '05 #5

"David Griffiths" <cl************@yahoo.com.hk> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
To Howard:

Thank you for helping me again.
Are you talking about some kind of database with login and security
features?
Exactly.
or as complex as a relational database back end with a login-protected, client-server front end.

Exactly.
Are you looking for design assistance? Or basic programming assistance?
Actually, both. How can I start coding without any design?
If you're really a beginner, then you need to work with some good books
on the subject, and taking some courses wouldn't hurt.

I am a true beginner who've just learnt something like array,
differnet method of sorting data in an array, or this kinds of really
simple things at school.
If you need helpp designing some kind of specific system, then you
really

need to be more specific as to to what you're trying to do, and what
part
you have a problem with.

Actually, I am required to write a "seating-plan program".
Firstly, I need to collect and store all information of the applicants.
Secondly, I need to allocate them to different table but there're
several allocation rules such as grouping people with the same age
group or the same hobby. And also, the applicants should be able to
amend their submitted information easily. That's all my goal. Hope you
can help me.

-David Griffiths


I can't believe that you need a relational database with login and security
features for a "seating plan" program. It appears to me that this is really
just a one-user program, and that when you say the "applicants" can change
their info, you just mean that there's a way to re-enter the data stored in
a given record.

You most likely just need some input function to do that, and probably a way
to search for the record you want to alter (likely by name).

There are containers (vector, list, etc.) which can help you manage the data
better, but I'd bet that your classes haven't covered those yet.

Your data for each applicant should probably be stored in a single class,
say... Applicant? The members of the class would be their name, age, hobby,
or whatever information you've been instructed to use.

It sounds to me like you really should be speaking with other students about
their thoughts on this design. If you were in class when the assignment was
discussed, most likely you could tell by the current discussion going on
there exactly what the assignment was trying to demonstrate. You just need
to build on the basics you already know, and implement those new ideas that
were discussed. If you're really stuck, the instructor might help clarify
some points.

But you really should do the design work yourself. People here will help
with specific problems with the language, and help work out bugs you have
trouble spotting. But we're not too keen on doing homework for students.
Sorry.

-Howard

Aug 15 '05 #6
David Griffiths wrote:

To Josh:

Thank you for helping me again.

But I am still not quite understand what "store the people's
information inside a container holding all the information for one
person, and then store each persons information inside a container of
all people's information." means. And more importantly, how can I
achieve what you've said?


Well. If you just learned about arrays, then lets use those along with
another concept, the structure.

You need: a container which holds the information for one person.
Here it is:

struct Person
{
std::string Name;
int Age;
// Add whatever else you need to describe a single Person
};

And here is the container which can hold up to 100 Person 'objects'

Person AllPersons[100];

It is just an array (of size 100) of 'Person'.
Each Person has a Name, an Age, ...
So to access the data of the 3-rd Person, you would write:

AllPersons[2].Name = "Dave";
AllPersons[2].Age = 24;

--
Karl Heinz Buchegger
kb******@gascad.at
Aug 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Golf Nut | last post by:
hello all! I would like to create a session class which would transparently handle sessions as well as serialize, encode and compute an md5 hash of all $_REQUEST information. This would...
1
by: kazack | last post by:
Hi all it's me again with another question as I got further in my book. The chapter I am in covers structres, abstract data and classes. I only read through to the end of the coverage on...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
3
by: Joe C | last post by:
I have some code that performs bitwise operations on files. I'm trying to make the code portable on different endian systems. This is not work/school related...just trying to learn/understand. ...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
2
by: Tom | last post by:
1. I drag the sqlDataAdapter and sqlConnection from the tool bar to the web form. It creates automatically: protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; protected...
5
by: André Nogueira | last post by:
Hi there guys! I have one question... I'm doing a simple program in VB.Net 2003 that can store my personal notes, my IE favourites, some pictures, etc. I will also make an ASP.Net site (also in...
7
by: Ryan | last post by:
I'm in the process of learning more about building my ASP.NET website to use my SQL datastore and am a bit confused about how ADO.NET works with ASP.NET. This Microsoft article implies that using...
3
by: Jess | last post by:
Hello, I've been reading Effective C++ about multiple inheritance, but I still have a few questions. Can someone give me some help please? First, it is said that if virtual inheritance is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.