Code
Code
DESCRIPTION
Problem Description:
Specifications:
class Program:
method definitions:
ValidateResult(int a, int b): Calls oddnumber ev
r~eturn type : void
visibility: public
class Program:
method definitions:
ValidateResult(int a, int b} : Calls oddnumber ev
r·etlwn type : void
visibility: public
delegate definition
OddNumber()
Return type : void
Visibility: public
event definition:
eventOddNumber
Type : Oddnumber (delegate defined earlier )
Visibility: public
Task
IMPORTANT
Delegating name C
=" Cod ing
DESCRIPTION
Problem Description:
Specifications
method definitions:
Namelength(String name):
·" type: void
visibility: public
NumberOfWords(String name):
· :-tLwn type: void
visibility: public
otherwise.
Specifications
method definitions:
Namelength(String name):
r·eturn type: void
visibility: public
NumberOfWords(String name):
return type: void
visibility: public
CheckDigits(String name):
return type: voi d
visibility: public
CheckSymbols(String name):
return type: void
visibility: public
delegate definition:
Operation(String name)
Return type: void
Visibility: public
delegate definition:
Operation(String name)
Return type: v1,id
Visibility: public
Task
the name .
4. CheckSymbols(String name): returns number of symbols
in the name·
5. Delegate Operation(String name)
6. Now use the multicast delegate concept to call all 4
methods created above using one delegate Operation
IMPORTANT
DESCRIPTION
~Qecification:
: default
property: Name
· type : string
visibility: oublic
~~cclti_on:
class
class
: default
property: Name
return type: string
visibility: public
property: IsPosted
return type: bool
visibility: public
property: Views
return type: int
visibility: public
class Instagram
visibility: defa ult
class Instagram
visibility: default
member definition:
ViewReel( string Name, bool Posted)
return type: String
visibility: public
member definition:
DeleteReel(string Name, bool Posted)
return type: String
visibility: public
Task:
class Reel:
class lnstagram:
'1
Samgle ingut:
delet e it from t he li st and ret urn "Deleted". If not found
t hen ret urn "Not present".
SamRle inRut:
};
insta = new Instagram(reels);
\! a I'
Console.log(vr);
SamRle outRut:
,,.·,: present
Note:
• You can make suitable function calls and use the RUN
CODE button to check your main() method output.
SamP-le inP-ut:
<Reel>
Instagram(reels);
ta.DeleteReel( "Kacha Badam" , true );
vr);
SamP-le outP-ut:
, "7: present
Note:
• You can make suitable function calls and use the RUN
CODE button to check your main() method output.
present
Note:
( ' ,,1i'
. 1'
h ·1· ,,',I' r, ',
' .. I' I • 'I ,I' 11
1
f .i
EXECUTI O N TIME LI M I.T ·' . · ' '
, ·, ,;1, I
1,!I
'
1,1 .
5 seconds ,:i ,) , i! ,
· 1
,· I
,,
11, i
I ,1,
,11i
< PREV
DESCRIPTION
Specifications
class definitions:
class Internet:
data member:
string Name,
int Datalimit,
int Speed
Internet(string Name, int Datalimit, int Speed)
method definition:
DownloadMovie( int Size ):
return type : stri ng
visibility: pub lic
Complete the class Internet using the Specifications given
below. Consider default visibility of classes, data "elds, and
1
methods unless mentioned otherwise.
Specifications I
class def i nitions:
class Int ernet:
data member:
string Name~
int Datalimit-t
int Speed
Internet(string Name~ int DataLimit, int Speed):
method definition:
DownloadMovie(int Size):
return type : string
visibility: public
WatchMovie(int Size):
return type : string
visibility: public
Task
Class lnternetExceP-tion
• If any other exception is thrown t hen return "Other
exception ".
• Return "Watch listed" if no error is thrown.
Class lnternetExceRtion
Sample Input
Sample Output
be downloaded
NOTE:
• You can make suitable function calls .and use the RUN
CODE button to check you~ main() method output.