Professional Documents
Culture Documents
Coding
Coding
- Coding
DESCRIPTION
Specifications
class definitions:
class SpamDetector:
data members:
int PrimaryCount
int PromotionCount
int UpdateCount
visibility: private
__. ,:- A.uto Implemented properties
method definition:
Addmessage( String Email) :
return : String
visibility: public
int PrimaryCount
int PromotionCount
int UpdateCount
visibility: private
U':ir Auto Implemented properties
method definition:
Addmessage(String Email) :
return : String
visibility: public
"
p
Class SP-amDetector
l:i:
I - - •
I • I I
-
• I
~ ,,~~·v,rw·r>--- - ~-
Class ~RamDetector
• Write a code that updates the Email type count ori th~
basis of the following-
. . .
.
II
,.11
' :1:
,111
,1
!1
1i~t\, 11
,I 11 . .l1 . 1
1
1' : ,,,"
,I,.
, ' , ' ' ' ' ' ! I i'' II ' I ' , \ :;:: ,,,
• 11 I ,! I •
. UpdateCount with 1 ·
1
11 11
,J'
1
I',
1
I., Ii
I ','
,I I .,
,/' ii",, ,, · ,, ,
, '
1
'Ii /I''," 1 , t'1
1
,
1
•
1
1(r ,ii} 1
A/I· ii ·I
. .r i/J , i}jt,\ 11(11 . ,,,
. • ' 1lf 'i ' L:1" I I' I 111 ! . !
•
T , I ,Jil l
i
Ir' r ' iI
• . . 1
' ',
Class SusQendExceQtion
i 11
, I
Ii , ; ,
'! I, :
!: I :
- - ., ;:·: '., _ :1 I .
- define SuspendException g]as s,ct~' 'i v~"d from the Exception
1
class.
Class SP-amAttackExceQtion
Exception class ..
Sample Input
1111,'
.111111 ,111111,1·
1111
NOTE:
1111 i1w1
,,1
,, 11111
111 , 111111
• • 111
111
111111
,1, iilll;I ,,, 1:1111 I
1 1 1
' ,1111 -111111 "' '
11111111 , . I' .
You can make suitable.fune'ti·on d use the RU N-
1
11111
1 1
l/!s 11'1
11
e • • I
1
:
11
' ii' ' '.'
5 seconds
'.I
1
< PREVIOUS ,PROBLEM
--
. \
I
I < PREV
Digital India
- Coding
DESCRIPTION
Specifications
data member:
string[] Patterns
visibility: public
method definition:
Credit(f l oat amount)
r--eturn : float
visibility: public
Credit( string pattern, float amount)
return :float
visibility: public
Credit( string pattern, float amount, i nt tax)
r ~+11rn • fln.::1 +
data member:
string [] Patterns
visibility : ', l j_c
visibility: public
Credit( string pattern, f l~ at amount)
1· _ ·':
1
I"n : float
visibility: public
Credit( string pattern, float amount, int tax)
-·: •,-.:· : float
visibility: public
Class Payment
amount.
at_
-float Credit(st~ing_.g___ · . . . . .,. . .
1
• · Write a code that chet '"San)i\ /;l
• • I 1i!• , ,' ,' t ur.ir the !'Iii" ,I;
amount as it is if -
1
II ·1 11111 ' I' :11: I' • f :I
of the am_
ount. 1 •• ,
I'
.
' '
\
II J -1'I I t • II . ' ,
11 ' 1
be created using the characters of any of the
patterns{string) from the Patterns list, else return 110%
of t he amount.
Sample Input 1
Console.Writeline(d);
Sample Output 1
then it returns the amount else it returns amount+tax.
Sample Input 1
Sample Output 1
Sample Input 2
Console.Writeline(d);
Sample Output 2
Sample Output 2
NOTE:
5 seconds . ' .
-
;_ :
-
=-- =
-
"" C -
. !
< PREVIOUS l?ROBLEM -FINISH AND ~
"
... - ,..,,_,,.,,,_,,, .._, "'' """-""'' """- .,,,,. ..... ,,.... ,,,, ..... ,, . .....,.,
,
1• ., ;;1'
111 i Ii •
' II• I I' I, I :1
1' Ill I 11 I 'I
I, Ii Ill I 11·: ii !I' 'I 'I
1
' i
1 111 '' Ii
Sample Output 2
NOTE:
..
,I ;i' ,II / ( 1• J
I
11
1'(11 /!' 1i1i1
1
I 11 I' I
',
11li l,1i 1, ' ',I I
' ,I
5 Seconds ii
11 ii ,,,,,, , '/, '," !
;I
I I 1i
i1
i ' 1/ II '
1
'
'I ,'
1
,I 11 ·1
ti ,: 11, 11
, II I .I /,III 1[
I 1 ,II ![
1
, 11· / 1' II
I I I I 111' II
I, I II
, 11
I < PREV
Summing Prime [
- Coding
DESCRIPTION
Problem Statem·ent
,:,,,,, JSe.return
:· " . ,"No". (without . -
_
-
quotes)
, -· ·,· .. ·!,
Input Format -
I ,. .f
,. i' -~ •i'
' .;
, ... i
i,·; • , .
• •
. . I
;"
ii 1,
I
I, ,t , .-1
1 I II I
I , • 'r l,1i
Constraints
1
• I
I lfl'li I ;11·11 )1
1
1'1
I , 1111 I
I 1,11
1,
Problem Statement
Input Format i ii
Constraints
Ii
' I
Output Format /,
!' 'f
' ' I •
Evaluation Para.meters
11 ' 11
( . I I I .; ; ' I II J
. I 1111
, ~,1:. l ,
'I I
I-
I ' -~ '.
Input t-ormat
Constraints
Output Format
Evaluation Parameters
• Sample Input
• Sample Output
• Explanation
• Explanation
EXECUTI ON TI M E LIMIT .
5 seconds
- ---·
-·-· ~- _PREVIOUS PROBLEM .:
,-I'l__-• __ FINISH AND SU
,, '
I ,,
,,,
. \
I
1111
;II
,I
I
'I
'11
I
~:.t.YYf:15.idi>:;g~.;t'~~~-- !'~'"L:~~..,;_:~:a-~r·._;:~
CODE: INPUl OU, Pl 11
C# ..... 0 R.'-lH ( . on~ "'". ' l"t ~\l", •
1 - us ing System;
2 us ing Syst:em.Collections .Ge n e r1c;
3 us ing System.IO;
4 us ing System . Linq~
5
6T class SpamDetector{
7 / / Code Here ..
8 }
9
10 T cla s s SpamAttackException Exception{.
11 I / Code Here . .
I
12 }
13
14• cl as s SuspendException Exception{
15 I /C ode Here.:.
l6 }
17
18 ... c l a ss Source {
-19 .,. stat ic void Main( stringt1 args) \
I * Enter your code here. Read in~ut. from S,t)1.~. ~r-i.nt. O\l~ ~u'- t.o S\t
20
21 }
...
22 I
}
.; J:
~11
l "--' V l'l ::>VLV t u I
CODE INPUT OUTPUT C# ,.. O, R UNC.0 0 £ =-, \I£~,~~ .•
l • usi ng System;
2 using System.Collections.Generic;
3 using System.IO;
4 using System.Linq;
5
6• class Payment{
7 II Code here
8 .}
9
1
10 ... class Sour,ce {
11 • static void Matn( string() args) {
12 / * Enter your .. code here. Read input. from S\1)1.\-1. ?rint. out.\mt. t o '
13 }
14 }
15
class Result {
/*
* Complete the 'summingPr i me ' f u nc tion below .
*
* The function :fs expected to retu rn a n StRING .
* The function accepts INTEGER n as pa rameter .
*
*I
G
pu blic static string summingPrime( int n) {
// Write your code here
}
}
public c~ass Source {
public static void Main( string() args) {
•• • __ /'\. T ...... ~w,(\\•
.----~- ·-=,<...,,."~-
I•
t ornr,) , ..t,,. ti-.e
:;.,;...,...11..,.gPr:,. - ... .c
+ The funct.i or-
is ewce ~t e d t~ ~-tur
.. The -functio,-, ~--· <',i~lW
acceo~c; 1 -1,E Gt.~ .... ~·::- p ~r .,:\f'f',c1,4 o.-
*
*/
p ubli c static string s umrnin gPrime (int n ) \
// Wri t e yo u r code here
}
}
I
p u b l i c class Source {
pub l ic static void Main( stringt 1 args ) {
int n ' = Convert.Tolnt32(Console. Readline \).1,im \))~
str i ng result = Result.summing?rime (n)~
Console.Writeline(result);
.}
}