Question: How do you read information from main into your classes and run functions? For example in main I have these lines of code. My overall

How do you read information from main into your classes and run functions? For example in main I have these lines of code. My overall program needs to make derived classes from a abstract class called Investment. Can you give me example how one of these derived classes can retrieve string for name, and the double for balance and store them to be used in the program? vector investmentList;

//Commodity( Name, COMMODITY_TYPE, Balance ) investmentList.push_back(new Commodity("Bill",GOLD,1500));

//RealEstate(Name, Balance) investmentList.push_back(new RealEstate("Susan", 35000));

//Stock(Name, Balance) investmentList.push_back(new Stock("John", 20100));

//SavingsAccount(Name, Balance) investmentList.push_back(new SavingsAccount("Ravi", 3100));

//SavingsAccount(Name, Balance) investmentList.push_back(new SavingsAccount("Sandy", 1000));

//RealEstate(Name, Account Number, Balance) investmentList.push_back(new RealEstate("Jamal", 20200)); //Commodity(name, COMMODITY_TYPE, Balance) investmentList.push_back(new Commodity("Hamid", SOLAR, 51001));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!