1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <quiz >
3
+ <!-- question: 53194 -->
4
+ <question type =" coderunner" >
5
+ <name >
6
+ <text >C# sqr method</text >
7
+ </name >
8
+ <questiontext format =" html" >
9
+ <text ><![CDATA[ <p>Write a static C# method <code>static int sqr(int n)</code> that returns the square of its parameter <code>n</code>. Write only the method, not the test class - your method will be wrapped in a class when tested.</p>]]> </text >
10
+ </questiontext >
11
+ <generalfeedback format =" html" >
12
+ <text ></text >
13
+ </generalfeedback >
14
+ <defaultgrade >1</defaultgrade >
15
+ <penalty >0</penalty >
16
+ <hidden >0</hidden >
17
+ <idnumber ></idnumber >
18
+ <coderunnertype >csharpdotnetmethod</coderunnertype >
19
+ <prototypetype >0</prototypetype >
20
+ <allornothing >1</allornothing >
21
+ <penaltyregime >10, 20, ...</penaltyregime >
22
+ <precheck >0</precheck >
23
+ <hidecheck >0</hidecheck >
24
+ <showsource >0</showsource >
25
+ <answerboxlines >8</answerboxlines >
26
+ <answerboxcolumns >100</answerboxcolumns >
27
+ <answerpreload ></answerpreload >
28
+ <globalextra ></globalextra >
29
+ <useace ></useace >
30
+ <resultcolumns ></resultcolumns >
31
+ <template ></template >
32
+ <iscombinatortemplate ></iscombinatortemplate >
33
+ <allowmultiplestdins ></allowmultiplestdins >
34
+ <answer >static int sqr(int n) {
35
+ return n * n;
36
+ }</answer >
37
+ <validateonsave >1</validateonsave >
38
+ <testsplitterre ></testsplitterre >
39
+ <language ></language >
40
+ <acelang ></acelang >
41
+ <sandbox ></sandbox >
42
+ <grader ></grader >
43
+ <cputimelimitsecs ></cputimelimitsecs >
44
+ <memlimitmb ></memlimitmb >
45
+ <sandboxparams ></sandboxparams >
46
+ <templateparams ></templateparams >
47
+ <hoisttemplateparams >1</hoisttemplateparams >
48
+ <extractcodefromjson >1</extractcodefromjson >
49
+ <templateparamslang >None</templateparamslang >
50
+ <templateparamsevalpertry >0</templateparamsevalpertry >
51
+ <templateparamsevald ><![CDATA[ {"total_time_budget":10,"warnings_are_errors":true,"profiling":false}]]> </templateparamsevald >
52
+ <twigall >0</twigall >
53
+ <uiplugin ></uiplugin >
54
+ <uiparameters ></uiparameters >
55
+ <attachments >0</attachments >
56
+ <attachmentsrequired >0</attachmentsrequired >
57
+ <maxfilesize >10240</maxfilesize >
58
+ <filenamesregex ></filenamesregex >
59
+ <filenamesexplain ></filenamesexplain >
60
+ <displayfeedback >1</displayfeedback >
61
+ <giveupallowed >0</giveupallowed >
62
+ <prototypeextra ></prototypeextra >
63
+ <testcases >
64
+ <testcase testtype =" 0" useasexample =" 1" hiderestiffail =" 0" mark =" 1.0000000" >
65
+ <testcode >
66
+ <text >Console.WriteLine(sqr(-11));</text >
67
+ </testcode >
68
+ <stdin >
69
+ <text ></text >
70
+ </stdin >
71
+ <expected >
72
+ <text >121</text >
73
+ </expected >
74
+ <extra >
75
+ <text ></text >
76
+ </extra >
77
+ <display >
78
+ <text >SHOW</text >
79
+ </display >
80
+ </testcase >
81
+ <testcase testtype =" 0" useasexample =" 1" hiderestiffail =" 0" mark =" 1.0000000" >
82
+ <testcode >
83
+ <text >Console.WriteLine(sqr(100));</text >
84
+ </testcode >
85
+ <stdin >
86
+ <text ></text >
87
+ </stdin >
88
+ <expected >
89
+ <text >10000</text >
90
+ </expected >
91
+ <extra >
92
+ <text ></text >
93
+ </extra >
94
+ <display >
95
+ <text >SHOW</text >
96
+ </display >
97
+ </testcase >
98
+ <testcase testtype =" 0" useasexample =" 0" hiderestiffail =" 0" mark =" 1.0000000" >
99
+ <testcode >
100
+ <text >Console.WriteLine(sqr(-100));</text >
101
+ </testcode >
102
+ <stdin >
103
+ <text ></text >
104
+ </stdin >
105
+ <expected >
106
+ <text >10000</text >
107
+ </expected >
108
+ <extra >
109
+ <text ></text >
110
+ </extra >
111
+ <display >
112
+ <text >SHOW</text >
113
+ </display >
114
+ </testcase >
115
+ <testcase testtype =" 0" useasexample =" 0" hiderestiffail =" 0" mark =" 1.0000000" >
116
+ <testcode >
117
+ <text >Console.WriteLine(sqr(0));</text >
118
+ </testcode >
119
+ <stdin >
120
+ <text ></text >
121
+ </stdin >
122
+ <expected >
123
+ <text >0</text >
124
+ </expected >
125
+ <extra >
126
+ <text ></text >
127
+ </extra >
128
+ <display >
129
+ <text >SHOW</text >
130
+ </display >
131
+ </testcase >
132
+ <testcase testtype =" 0" useasexample =" 0" hiderestiffail =" 0" mark =" 1.0000000" >
133
+ <testcode >
134
+ <text >Console.WriteLine(sqr(-17));</text >
135
+ </testcode >
136
+ <stdin >
137
+ <text ></text >
138
+ </stdin >
139
+ <expected >
140
+ <text >289</text >
141
+ </expected >
142
+ <extra >
143
+ <text ></text >
144
+ </extra >
145
+ <display >
146
+ <text >HIDE</text >
147
+ </display >
148
+ </testcase >
149
+ </testcases >
150
+ </question >
151
+
152
+ </quiz >
0 commit comments