<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 30287329  -->
  <question type="coderunner">
    <name>
      <text>Code Ausgabe Arrays 05</text>
    </name>
    <questiontext format="markdown">
      <text><![CDATA[Enter the return value from the function func() in the field below!

```java
public int func()
{
    int[] arr = { {{val1}}, {{val2}}, {{val3}}, {{val4}}, {{val5}} };
    
    int sum = 0;
    int x = 0;
    do
    {
        sum+=arr[x];
        x++;
    }while(sum < 40);

    return sum;
}
```]]></text>
    </questiontext>
    <generalfeedback format="markdown">
      <text></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <coderunnertype>java_method</coderunnertype>
    <prototypetype>0</prototypetype>
    <allornothing>1</allornothing>
    <penaltyregime>50, 100, ...</penaltyregime>
    <precheck>0</precheck>
    <hidecheck>0</hidecheck>
    <showsource>0</showsource>
    <answerboxlines>5</answerboxlines>
    <answerboxcolumns>100</answerboxcolumns>
    <answerpreload>//Please enter the return value e.g int num = 50 
int num = ;</answerpreload>
    <globalextra><![CDATA[public int func()
{
    int[] arr = { {{val1}}, {{val2}}, {{val3}}, {{val4}}, {{val5}} };
    
    int sum = 0;
    int x = 0;
    do
    {
        sum+=arr[x];
        x++;
    }while(sum < 40);

    return sum;
}]]></globalextra>
    <useace></useace>
    <resultcolumns></resultcolumns>
    <template><![CDATA[public class __tester__ {
    
    {{ STUDENT_ANSWER }}
    
    {{ QUESTION.globalextra }}

    String testFunctionString = "{{ QUESTION.globalextra | e('java') }}";
    String studentAnswerString = "{{ STUDENT_ANSWER | e('java') }}";

    public static void main(String[] args) {
        __tester__ main = new __tester__();
        main.runTests();
    }

    public void runTests() {
        {{ TEST.testcode }};
    }
}]]></template>
    <iscombinatortemplate>0</iscombinatortemplate>
    <allowmultiplestdins></allowmultiplestdins>
    <answer></answer>
    <validateonsave>1</validateonsave>
    <testsplitterre></testsplitterre>
    <language></language>
    <acelang></acelang>
    <sandbox></sandbox>
    <grader></grader>
    <cputimelimitsecs></cputimelimitsecs>
    <memlimitmb></memlimitmb>
    <sandboxparams></sandboxparams>
    <templateparams><![CDATA[{
"x": {{ random(4) }},
"y": {{ random(4) }},
"val1": {{ random(40)+10 }},
"val2": {{ random(40)+10 }},
"val3": {{ random(40)+10 }},
"val4": {{ random(40)+10 }},
"val5": {{ random(40)+10 }},
"var": "{{random(["<","<=",">",">=","==","!="])}}"
}]]></templateparams>
    <hoisttemplateparams>1</hoisttemplateparams>
    <templateparamslang>twig</templateparamslang>
    <templateparamsevalpertry>0</templateparamsevalpertry>
    <templateparamsevald><![CDATA[{"x":3,"y":1,"val1":17,"val2":20,"val3":47,"val4":15,"val5":15,"var":">"}]]></templateparamsevald>
    <twigall>1</twigall>
    <uiplugin></uiplugin>
    <uiparameters></uiparameters>
    <attachments>0</attachments>
    <attachmentsrequired>0</attachmentsrequired>
    <maxfilesize>10240</maxfilesize>
    <filenamesregex></filenamesregex>
    <filenamesexplain></filenamesexplain>
    <displayfeedback>1</displayfeedback>
    <testcases>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000" >
      <testcode>
                <text>System.out.println(func()==num);</text>
      </testcode>
      <stdin>
                <text></text>
      </stdin>
      <expected>
                <text>true</text>
      </expected>
      <extra>
                <text></text>
      </extra>
      <display>
                <text>SHOW</text>
      </display>
    </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000" >
      <testcode>
                <text><![CDATA[System.out.println(studentAnswerString.contains("{") || studentAnswerString.contains("}"));]]></text>
      </testcode>
      <stdin>
                <text></text>
      </stdin>
      <expected>
                <text>false</text>
      </expected>
      <extra>
                <text></text>
      </extra>
      <display>
                <text>SHOW</text>
      </display>
    </testcase>
      <testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000" >
      <testcode>
                <text><![CDATA[System.out.println(studentAnswerString.contains("func()"));]]></text>
      </testcode>
      <stdin>
                <text></text>
      </stdin>
      <expected>
                <text>false</text>
      </expected>
      <extra>
                <text></text>
      </extra>
      <display>
                <text>SHOW</text>
      </display>
    </testcase>
    </testcases>
  </question>

</quiz>