By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

Design of C++ Periodic table project

P: n/a
Hi there,
I am looking to design a project using C++

The main objective of the project is to display details of periodic
table elements such as periodic element name, properties(such as atomic
number and atomic mass) for each periodic number entered by user. I am
thinking to input all the data regarding each periodic element number
in form of class.

Please give your opinion on the correct design method for the same.

Thanks

Nishant

ni*******@rediffmail.com

Mar 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> The main objective of the project is to display details of periodic
table elements such as periodic element name, properties(such as atomic
number and atomic mass) for each periodic number entered by user. I am
thinking to input all the data regarding each periodic element number
in form of class.

Please give your opinion on the correct design method for the same.


creating a class that represents one element is good design.
that class can not only hold the properties, but also be used to draw itself
on your table (if you want one on the screen). after all, the elements
themselves know best where they should be drawn in that table

if you have a collection of elements you can then simply draw them like
this:
//assuming you are using C++/CLI. otherwise you have to do it slightly
different
//also assuming that the element class has a Draw method
foreach(Element e in ElementCollection)
{
e->Draw(....);
}

to store your table you can use a simple database that holds all properties
of an element.
you can load the database during startup so that you can easily adapt your
the data you display for each element.

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.