Hello all, I am a newbie to this forum and to C++. I am not asking anyone to write the code (although any help would indeed be appreciated);-), just some insight as to what components anyone else would use on the Form Builder to solve this problem. I hope I am asking in the right forum.
My problem here (like many others) is that I am not entirely sure how to start this process.
What I am trying to do is create a program for maintaining a table of shares that has some or all of the following features.
1. It should have a means by which the user can inspect information on an individual share.
2. It should have a means by which the user can edit and save information on an individual share.
3. It should have a means of adding details on a new share to the table.
4. It should have a means of displaying a list of all the shares; for each entry in the list the name and current price of the share should be given.
I am trying to develop an interface using the provided engine. I am using Borland Builder v5
code
//---------------------------------------------------------
#ifndef ShareEngineH // written in header file.
#define ShareEngineH // written in header file.
//---------------------------------------------------------
Struct ShareType
{
AnsiString Name; // The identifier of the share.
int Now; // The current price per share.
int High; // The highest price of the share in the past 12 months.
int Low; // The lowest price of the share in the past 12 months.
};
class ShareTableType
{
private:
// Not Shown here.
// An object of this class represents a table
// containing information on up to 100 shares.
ShareType Shares[101]; // written in header file.
int LastFound; // written in header file.
public:
void Initialise(void);
// Initialises the table of shares which are indexed from 1 to 100.
// Empty entries are given value " " for Name.
ShareType GetShare(int I);
// Returns the information on share at index I. If I is an
// inappropriate value the dummy share with name "*" is returned.
ShareType FindShare(AnsiString TryName);
// Returns information on a share with name TryName, if such exists.
// Otherwise returns the dummy share with name "*".
bool NewShare(ShareType Addition);
// Records the details of the new share (Addition), provided there
// is room available. Returns true if there is room; false otherwise.
void EditedShare(ShareType Updated);
// Records the revised details of a share. This method must be used
// with GetShare as it is the last record found by GetShare which will
// be updated.
};
endif // written in header file.
[/code]
Any Help/guidance will be greatly appreciated.
Morphios
My problem here (like many others) is that I am not entirely sure how to start this process.
What I am trying to do is create a program for maintaining a table of shares that has some or all of the following features.
1. It should have a means by which the user can inspect information on an individual share.
2. It should have a means by which the user can edit and save information on an individual share.
3. It should have a means of adding details on a new share to the table.
4. It should have a means of displaying a list of all the shares; for each entry in the list the name and current price of the share should be given.
I am trying to develop an interface using the provided engine. I am using Borland Builder v5
code
//---------------------------------------------------------
#ifndef ShareEngineH // written in header file.
#define ShareEngineH // written in header file.
//---------------------------------------------------------
Struct ShareType
{
AnsiString Name; // The identifier of the share.
int Now; // The current price per share.
int High; // The highest price of the share in the past 12 months.
int Low; // The lowest price of the share in the past 12 months.
};
class ShareTableType
{
private:
// Not Shown here.
// An object of this class represents a table
// containing information on up to 100 shares.
ShareType Shares[101]; // written in header file.
int LastFound; // written in header file.
public:
void Initialise(void);
// Initialises the table of shares which are indexed from 1 to 100.
// Empty entries are given value " " for Name.
ShareType GetShare(int I);
// Returns the information on share at index I. If I is an
// inappropriate value the dummy share with name "*" is returned.
ShareType FindShare(AnsiString TryName);
// Returns information on a share with name TryName, if such exists.
// Otherwise returns the dummy share with name "*".
bool NewShare(ShareType Addition);
// Records the details of the new share (Addition), provided there
// is room available. Returns true if there is room; false otherwise.
void EditedShare(ShareType Updated);
// Records the revised details of a share. This method must be used
// with GetShare as it is the last record found by GetShare which will
// be updated.
};
endif // written in header file.
[/code]
Any Help/guidance will be greatly appreciated.
Morphios