Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
League.cpp
SUBMITTED BY:
Guest
DATE:
Sept. 5, 2014, 9:06 p.m.
FORMAT:
C++
SIZE:
889 Bytes
Raw
Download
Tweet
HITS:
618
Go to comments
Report
#include
<iostream>
#include
"sleague.h"
using
namespace
std
;
Team
::
Team
(
char
n
[],
int
s
,
int
f
)
{
name
=
n
;
skill
=
s
;
form
=
f
;
}
Team
::
Team
()
{
name
=
""
;
skill
=
0
;
form
=
0
;
}
int
Team
::
setskill
(
int
s
){
int
oldskill
=
skill
;
skill
=
s
;
return
oldskill
;
}
int
Team
::
setform
(
int
f
){
int
oldform
=
form
;
form
=
f
;
return
oldform
;
}
League
::
League
()
{
teamcnt
=
0
;
}
int
League
::
leagueteams
()
{
return
teamcnt
;
}
int
League
::
addteam
(
Team
&
n
)
{
teams
=
new
Team
[
teamcnt
];
*
teams
=
n
;
teams
++
;
teamcnt
++
;
return
teamcnt
;
}
void
League
::
printteams
()
{
for
(
int
i
=
0
;
i
<
teamcnt
;
i
++
){
cout
<<
teams
->
name
<<
endl
;
teams
++
;
}
}
Please enable JavaScript to view the
comments powered by Disqus.