0 Replies - 647 Views - Last Post: 18 April 2010 - 05:05 PM Rate Topic: -----

#1 Dokkan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 25-January 10

Investment class help. Need help coming up with functions and variable

Posted 18 April 2010 - 05:05 PM

I need a lot of help on this problem. I'm not really sure about how to come up with all the functions and variables to do this.

Create an Investment class that includes the appropriate data members for various types of investments. Write appropriate get and set functions for each data member.
Also include a data member that holds the investment’s total value. Use a parameterized constructor to receive the name of each investment in a string* pointer. Be sure to include a destructor to clean up the heap when each object is destroyed. Also include a static data member and a static member function that calculates the total worth of an investment portfolio by adding together the total value of data members for each instantiated object. Add the Investment class to a console application, and then instantiate an Investment object and initialize its data. Create two additional Investment objects by copying the original object. You will need to write a copy constructor for when you duplicate objects. Retrieve and print the data members for each object. Also print the contents of the static data member using a statement similar to “Your investments are worth a total of $100,000.”

Here is some of the header file.

#include <iostream>
#include <string>
using namespace std;
class Investment
	void Investment(String*);
	void ~Investment();
	int getInvestment();
        int setInvestment();


This post has been edited by JackOfAllTrades: 18 April 2010 - 06:58 PM
Reason for edit:: Fixed code tags.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1