Difference: CodeClass2 (3 vs. 4)

Revision 42017-04-11 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Classes

Line: 78 to 78
  %ENDCODE%

The Date Class

Changed:
<
<
#include < stream.h > #include < math.h > #include < stdlib.h >
>
>
%CODE{"c++"}% #include

using namespace std;

  int max (int a, int b) {
Line: 127 to 128
  void Date::display() {
Changed:
<
<
static char *name[] = {"nothing", "January", "February", "March", "April",
>
>
static string name[] = {"nothing", "January", "February", "March", "April",
  "May", "June", "July", "August", "September", "October", "November", "December" };
Line: 161 to 162
  month = min(month, 12); }
Changed:
<
<
void main()
>
>
int main()
 { Date mydate(1, 2, 1993);
Changed:
<
<
Date date2(4,12,1994); Date date4; Date *date3; Date *date6; Date date5(1,1,1);
>
>
Date date2(4,11,2017); Date date3;
 
Changed:
<
<
date3 = new Date(45,45,44545);
>
>
Date date5(34,25,2034);
  mydate.display(); date2.display();
Changed:
<
<
date3->display();

cout << "OK: " << date3->GetMonth() << '\n'; date3->SetMonth(4); cout << "OK: " << date3->GetMonth() << '\n';

delete(date3); date6 = new Date(1,1,1);

cout << "OK: " << date3->GetMonth() << '\n'; date3->SetMonth(4); cout << "OK: " << date3->GetMonth() << '\n';

date3->display();

>
>
date3.display();
  date4.display();
Deleted:
<
<
date5.SetMonth(3); delete(date6);
 }
Deleted:
<
<
%ENDCODE%
 

The BankAccount Class

%CODE{"c++"}%
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback