Results 1 to 5 of 5
Thread: C++ :)
Hybrid View
-
5th April 2011 17:06 #1Registered User
Join Date: Jan:2009
Location:
Posts: 16
C++ :)
, :
Exercise P10.3. Enhance the Employee class to include a pointer to a BankAccount. Read
in employees and their salaries. Store them in a vector<Employee>. For each employee,
allocate a new bank account on the heap, except that two consecutive employees with the
same last name should share the same account. Then traverse the vector of employees
and, for each employee, deposit 1/12th of their annual salary into their bank account.
Afterwards, print all employee names and account balances.
Exercise P10.4. Enhance the preceding exercise to delete all bank account objects. Make
sure that no object gets deleted twice.
10.3, , ... 10.3. , error- 10.4!
!!!
!
10.3
10.4
Last edited by hskiller; 5th April 2011 at 17:26.
-
5th April 2011 17:29 #2
: using namespace std; #include-.
. , , , .
10.4 , , ( , ). , ., . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
6th April 2011 12:48 #3Registered User
Join Date: Jan:2009
Location:
Posts: 16
, ... !
-
6th April 2011 13:29 #4
10.4 - .
, . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
7th April 2011 18:41 #5Registered User
Join Date: Jan:2009
Location:
Posts: 16
! , !




Reply With Quote
R9 280,
7th May 2023, 21:28 in