<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
    <attributes>
        <attribute name="name" value=""/>
        <attribute name="authors" value="burrin"/>
        <attribute name="about" value=""/>
        <attribute name="saved" value="2021-05-08 03:17:56 PM"/>
        <attribute name="created" value="YnVycmluO0RFU0tUT1AtNzQ5RDJJRjsyMDIxLTA1LTA4OzExOjQ4OjMzIEFNOzI5MzM="/>
        <attribute name="edited" value="YnVycmluO0RFU0tUT1AtNzQ5RDJJRjsyMDIxLTA1LTA4OzEyOjM2OjQwIFBNOzE7YnVycmluO0RFU0tUT1AtNzQ5RDJJRjsyMDIwLTEwLTMxOzExOjEyOjIzIEFNO1RvVXBwZXIuZnByZzs3Mjgw"/>
        <attribute name="edited" value="YnVycmluO0RFU0tUT1AtNzQ5RDJJRjsyMDIxLTA1LTA4OzAzOjE3OjU2IFBNOzk7MzA2Ng=="/>
    </attributes>
    <function name="Main" type="None" variable="">
        <parameters/>
        <body>
            <declare name="Valid" type="Boolean" array="False" size=""/>
            <assign variable="Valid" expression="False"/>
            <declare name="Score" type="Integer" array="False" size=""/>
            <assign variable="Score" expression="0"/>
            <declare name="Qnum" type="Integer" array="False" size=""/>
            <declare name="counter" type="Integer" array="False" size=""/>
            <declare name="guess" type="String" array="False" size=""/>
            <declare name="Questions" type="String" array="True" size="5"/>
            <declare name="Answers" type="String" array="True" size="5"/>
            <declare name="A" type="String" array="True" size="5"/>
            <comment text="Putting the answer options in the ABCD arrays"/>
            <assign variable="A[0]" expression="&quot;Flash Drive&quot;"/>
            <assign variable="A[1]" expression="&quot;Hub&quot;"/>
            <assign variable="A[2]" expression="&quot;Bespoke&quot;"/>
            <assign variable="A[3]" expression="&quot;Mebibyte&quot;"/>
            <assign variable="A[4]" expression="&quot;Database&quot;"/>
            <declare name="B" type="String" array="True" size="5"/>
            <assign variable="B[0]" expression="&quot;Hard Drive&quot;"/>
            <assign variable="B[1]" expression="&quot;Modem&quot;"/>
            <assign variable="B[2]" expression="&quot;Freeware&quot;"/>
            <assign variable="B[3]" expression="&quot;Petabyte&quot;"/>
            <assign variable="B[4]" expression="&quot;Email&quot;"/>
            <declare name="C" type="String" array="True" size="5"/>
            <assign variable="C[0]" expression="&quot;Solid State Drive&quot;"/>
            <assign variable="C[1]" expression="&quot;Router&quot;"/>
            <assign variable="C[2]" expression="&quot;Off-the-shelf&quot;"/>
            <assign variable="C[3]" expression="&quot;Pebibyte&quot;"/>
            <assign variable="C[4]" expression="&quot;Spreadsheet&quot;"/>
            <declare name="D" type="String" array="True" size="5"/>
            <assign variable="D[0]" expression="&quot;USB Stick&quot;"/>
            <assign variable="D[1]" expression="&quot;Switch&quot;"/>
            <assign variable="D[2]" expression="&quot;Shareware&quot;"/>
            <assign variable="D[3]" expression="&quot;Terabyte&quot;"/>
            <assign variable="D[4]" expression="&quot;Word Processor&quot;"/>
            <comment text="Questions and Answer"/>
            <assign variable="Questions[0]" expression="&quot;Which of the following is made up of spinning magnetic storage discs?&quot;"/>
            <assign variable="Answers[0]" expression="&quot;B&quot;"/>
            <assign variable="Questions[1]" expression="&quot;Which of the following devices converts digital data to analogue data?&quot;"/>
            <assign variable="Answers[1]" expression="&quot;B&quot;"/>
            <assign variable="Questions[2]" expression="&quot;A game magazine provides a link to download a new game which is initially provided as free,&#13;&#10;but has a built-in expiration date. This is an example of what kind of software?&quot;"/>
            <assign variable="Answers[2]" expression="&quot;B&quot;"/>
            <assign variable="Questions[3]" expression="&quot;Which of the following units of multiple bytes is equal to 1015 bytes?&quot;"/>
            <assign variable="Answers[3]" expression="&quot;B&quot;"/>
            <assign variable="Questions[4]" expression="&quot;Which of the productivity software below would be the most suitable for storing large amounts&#13;&#10;of online shopping transaction data?&quot;"/>
            <assign variable="Answers[4]" expression="&quot;A&quot;"/>
            <comment text="if i add more questions later this will re-do the loop sizes"/>
            <assign variable="Qnum" expression="Size(Questions)"/>
            <for variable="counter" start="0" end="Qnum-1" direction="inc" step="1">
                <output expression="Questions[counter]" newline="True"/>
                <output expression="&quot;A - &quot;&amp;A[counter]" newline="True"/>
                <output expression="&quot;B - &quot;&amp; B[counter]" newline="True"/>
                <output expression="&quot;C - &quot; &amp; C[counter]" newline="True"/>
                <output expression="&quot;D - &quot; &amp; D[counter]" newline="True"/>
                <assign variable="Valid" expression="False"/>
                <while expression="Valid == False">
                    <input variable="guess"/>
                    <comment text="make the guess upper case"/>
                    <assign variable="guess" expression="toUpper(guess)"/>
                    <comment text="only accepts A B C D as valid guesses"/>
                    <assign variable="Valid" expression="Validate(Guess)"/>
                </while>
                <if expression="guess = Answers[counter]">
                    <then>
                        <assign variable="Score" expression="Score + 1"/>
                        <output expression="&quot;correct&quot;" newline="True"/>
                    </then>
                    <else>
                        <output expression="&quot;wrong&quot;" newline="True"/>
                    </else>
                </if>
            </for>
            <output expression="&quot;Your score was &quot; &amp;Score &amp; &quot; This is &quot;&amp;(score/Qnum)*100 &amp; &quot;%&quot;" newline="True"/>
        </body>
    </function>
    <function name="ToUpper" type="String" variable="Uword">
        <parameters>
            <parameter name="lWord" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="letter" type="Integer" array="False" size=""/>
            <declare name="code" type="Integer" array="False" size=""/>
            <declare name="uWord" type="String" array="False" size=""/>
            <assign variable="uWord" expression="&quot;&quot;"/>
            <for variable="letter" start="0" end="len(lWord)-1" direction="inc" step="1">
                <assign variable="code" expression="ToCode(Char(lWord,letter))"/>
                <if expression="code &gt;96 AND code &lt;123">
                    <then>
                        <assign variable="code" expression="ToCode(Char(lWord,letter))-32"/>
                        <assign variable="uWord" expression="uWord &amp; ToChar(code)"/>
                    </then>
                    <else>
                        <assign variable="uWord" expression="uWord &amp; ToChar(code)"/>
                    </else>
                </if>
            </for>
        </body>
    </function>
    <function name="Validate" type="Boolean" variable="Valid">
        <parameters>
            <parameter name="guess" type="String" array="False"/>
        </parameters>
        <body>
            <declare name="Valid" type="Boolean" array="False" size=""/>
            <if expression="ToCode(guess) &gt;=65 AND ToCode(guess) &lt;=68">
                <then>
                    <assign variable="Valid" expression="True"/>
                </then>
                <else>
                    <assign variable="Valid" expression="False"/>
                    <output expression="&quot;invalide answer try again&quot;" newline="True"/>
                </else>
            </if>
        </body>
    </function>
</flowgorithm>
