<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
    <attributes>
        <attribute name="name" value=""/>
        <attribute name="authors" value="Big Buu"/>
        <attribute name="about" value=""/>
        <attribute name="saved" value="2020-10-28 07:45:18 PM"/>
        <attribute name="created" value="QmlnIEJ1dTtMQVBUT1AtUkFJTTFVNlQ7MjAyMC0xMC0wODswODowNzo0MyBBTTsyOTQ4"/>
        <attribute name="edited" value="QmlnIEJ1dTtMQVBUT1AtUkFJTTFVNlQ7MjAyMC0xMC0yNzswNDoxNzoyNSBQTTs2O2FsZWphO0RFU0tUT1AtUlBKQlNSQTsyMDIwLTEwLTI1OzEwOjQ4OjI4IFBNO0ZpbmFsIFNob3BwaW5nIENhcnQuZnByZzs4MzYw"/>
        <attribute name="edited" value="QmlnIEJ1dTtMQVBUT1AtUkFJTTFVNlQ7MjAyMC0xMC0yODsxMjo1MzoyMSBQTTsyNjszMTIw"/>
        <attribute name="edited" value="YnVycmluO0RFU0tUT1AtNzQ5RDJJRjsyMDIwLTEwLTI4OzA3OjQ1OjE4IFBNOzQ7MzA2MQ=="/>
    </attributes>
    <function name="Main" type="None" variable="">
        <parameters/>
        <body>
            <declare name="item" type="Integer" array="False" size=""/>
            <declare name="many" type="Integer" array="False" size=""/>
            <declare name="max" type="Integer" array="False" size=""/>
            <declare name="discount" type="String" array="False" size=""/>
            <declare name="disper" type="Real" array="False" size=""/>
            <declare name="total" type="Real" array="False" size=""/>
            <assign variable="total" expression="0"/>
            <declare name="tax" type="Real" array="False" size=""/>
            <assign variable="tax" expression=".07"/>
            <declare name="grandtotal" type="Real" array="False" size=""/>
            <assign variable="grandtotal" expression="0"/>
            <declare name="itemdis" type="Real" array="False" size=""/>
            <declare name="confirm" type="Integer" array="False" size=""/>
            <assign variable="confirm" expression="1"/>
            <declare name="cart" type="Integer" array="False" size=""/>
            <assign variable="cart" expression="0"/>
            <output expression="&quot;What is maximum amount of money you are going to spend?&quot;" newline="True"/>
            <input variable="max"/>
            <declare name="ava" type="Real" array="False" size=""/>
            <assign variable="ava" expression="max"/>
            <output expression="&quot;Your current avalible amount of money is $&quot; &amp; ava" newline="True"/>
            <declare name="global" type="Integer" array="False" size=""/>
            <assign variable="global" expression="1"/>
            <while expression="global &gt; 0">
                <output expression="&quot; You have $&quot; &amp; ava &amp; &quot;dollars to spend. Select your items by chossing the number of the item from the list below or 0 to check out&quot;" newline="True"/>
                <output expression="&quot;1) Roses  =  $75.00 per 1/2 dozen (25% discount) &quot; &amp;&#13;&#10;&#13;&#10; &#13;&#10;&#13;&#10;&quot;2) Hair extensions =  $100 per pack (10% discount) &quot; &amp;&#13;&#10;&#13;&#10; &#13;&#10;&#13;&#10;&quot;3) Male Jeans = $150.00 &quot; &amp; &#13;&#10;&#13;&#10; &#13;&#10;&#13;&#10;&quot;4)Female Jeans = $175.00 (5% discount)&quot;&amp;&#13;&#10;&#13;&#10; &#13;&#10;&#13;&#10;&quot;5)Jordans = $200.00 &quot;" newline="True"/>
                <output expression="&quot; Enter the number correspnding to the item you desire&quot;" newline="True"/>
                <input variable="item"/>
                <if expression="item == 0">
                    <then>
                        <assign variable="Global" expression="0"/>
                    </then>
                    <else>
                        <if expression="item == 1">
                            <then>
                                <assign variable="item" expression="75.00"/>
                                <output expression="&quot; How many of this item would you like&quot;" newline="True"/>
                                <input variable="many"/>
                                <assign variable="item" expression="many * item"/>
                                <assign variable="itemdis" expression="item"/>
                                <if expression="itemdis &lt;= ava">
                                    <then>
                                        <if expression="many &gt; 1">
                                            <then>
                                                <assign variable="cart" expression="cart + many"/>
                                            </then>
                                            <else>
                                                <assign variable="cart" expression="cart + 1"/>
                                            </else>
                                        </if>
                                    </then>
                                    <else/>
                                </if>
                                <if expression="many &gt; 1">
                                    <then>
                                        <assign variable="cart" expression="cart + many"/>
                                    </then>
                                    <else>
                                        <assign variable="cart" expression="cart + 1"/>
                                    </else>
                                </if>
                            </then>
                            <else>
                                <if expression="item == 2">
                                    <then>
                                        <assign variable="item" expression="100.00"/>
                                        <output expression="&quot; How many of this item would you like&quot;" newline="True"/>
                                        <input variable="many"/>
                                        <assign variable="item" expression="many * item"/>
                                        <assign variable="itemdis" expression="item"/>
                                        <if expression="itemdis &lt;= ava">
                                            <then>
                                                <if expression="many &gt; 1">
                                                    <then>
                                                        <assign variable="cart" expression="cart + many"/>
                                                    </then>
                                                    <else>
                                                        <assign variable="cart" expression="cart + 1"/>
                                                    </else>
                                                </if>
                                            </then>
                                            <else/>
                                        </if>
                                        <if expression="many &gt; 1">
                                            <then>
                                                <assign variable="cart" expression="cart + many"/>
                                            </then>
                                            <else>
                                                <assign variable="cart" expression="cart + 1"/>
                                            </else>
                                        </if>
                                    </then>
                                    <else>
                                        <if expression="item == 3">
                                            <then>
                                                <assign variable="item" expression="150.00"/>
                                                <output expression="&quot; How many of this item would you like&quot;" newline="True"/>
                                                <input variable="many"/>
                                                <assign variable="item" expression="many * item"/>
                                                <assign variable="item" expression="item * Tax + item"/>
                                                <assign variable="itemdis" expression="item"/>
                                                <if expression="itemdis &lt;= ava">
                                                    <then>
                                                        <if expression="many &gt; 1">
                                                            <then>
                                                                <assign variable="cart" expression="cart + many"/>
                                                            </then>
                                                            <else>
                                                                <assign variable="cart" expression="cart + 1"/>
                                                            </else>
                                                        </if>
                                                    </then>
                                                    <else/>
                                                </if>
                                                <if expression="many &gt; 1">
                                                    <then>
                                                        <assign variable="cart" expression="cart + many"/>
                                                    </then>
                                                    <else>
                                                        <assign variable="cart" expression="cart + 1"/>
                                                    </else>
                                                </if>
                                            </then>
                                            <else>
                                                <if expression="item == 4">
                                                    <then>
                                                        <assign variable="item" expression="175.00"/>
                                                        <output expression="&quot;How many of this item would you like&quot;" newline="True"/>
                                                        <input variable="many"/>
                                                        <assign variable="item" expression="many * item"/>
                                                        <assign variable="itemdis" expression="item"/>
                                                        <if expression="itemdis &lt;= ava">
                                                            <then>
                                                                <if expression="many &gt; 1">
                                                                    <then>
                                                                        <assign variable="cart" expression="cart + many"/>
                                                                    </then>
                                                                    <else>
                                                                        <assign variable="cart" expression="cart + 1"/>
                                                                    </else>
                                                                </if>
                                                            </then>
                                                            <else/>
                                                        </if>
                                                        <if expression="many &gt; 1">
                                                            <then>
                                                                <assign variable="cart" expression="cart + many"/>
                                                            </then>
                                                            <else>
                                                                <assign variable="cart" expression="cart + 1"/>
                                                            </else>
                                                        </if>
                                                    </then>
                                                    <else>
                                                        <if expression="item == 5">
                                                            <then>
                                                                <assign variable="item" expression="200.00"/>
                                                                <output expression="&quot; How many of this item would you like&quot;" newline="True"/>
                                                                <input variable="many"/>
                                                                <assign variable="item" expression="many * item"/>
                                                                <assign variable="item" expression="item * Tax + item"/>
                                                                <assign variable="itemdis" expression="item"/>
                                                                <comment text="only add to cart if you can afford it"/>
                                                                <if expression="itemdis &lt;= ava">
                                                                    <then>
                                                                        <if expression="many &gt; 1">
                                                                            <then>
                                                                                <assign variable="cart" expression="cart + many"/>
                                                                            </then>
                                                                            <else>
                                                                                <assign variable="cart" expression="cart + 1"/>
                                                                            </else>
                                                                        </if>
                                                                    </then>
                                                                    <else/>
                                                                </if>
                                                            </then>
                                                            <else/>
                                                        </if>
                                                    </else>
                                                </if>
                                            </else>
                                        </if>
                                    </else>
                                </if>
                            </else>
                        </if>
                    </else>
                </if>
                <comment text="fix the problem of getting a discount on exit"/>
                <if expression="global !=0">
                    <then>
                        <output expression="&quot; Does this item has a discount? Enter 1 for yes 2 for no.&quot;" newline="True"/>
                        <input variable="discount"/>
                        <if expression="discount == &quot;1&quot;">
                            <then>
                                <output expression="&quot;How much is the discount percentage?&quot;" newline="True"/>
                                <output expression="&quot;When inputting percentage make sure to put the percentage make sure to put the percentage in decimal for&#13;&#10;&#13;&#10;&#13;&#10;&#13;&#10;Example: 25% = .25 or 7% = .07&quot;" newline="True"/>
                                <input variable="disper"/>
                                <assign variable="item" expression="item"/>
                                <assign variable="itemdis" expression="itemdis * disper"/>
                                <assign variable="item" expression="item - itemdis"/>
                                <assign variable="ava" expression="ava - item"/>
                            </then>
                            <else>
                                <assign variable="ava" expression="ava - item"/>
                                <comment text="removed cart removal as no longer adding when can't afford"/>
                            </else>
                        </if>
                        <if expression="ava &gt; 0">
                            <then>
                                <assign variable="total" expression="total + item"/>
                            </then>
                            <else>
                                <assign variable="ava" expression="ava + item"/>
                                <output expression="&quot;You don't have enough funds available to purchase those item(s).&quot;" newline="True"/>
                            </else>
                        </if>
                        <assign variable="GrandTotal" expression="total"/>
                    </then>
                    <else/>
                </if>
            </while>
            <output expression="&quot;Your Grand Total is $&quot;&amp;GrandTotal" newline="True"/>
            <declare name="fp" type="Real" array="False" size=""/>
            <assign variable="fp" expression="ava- GrandTotal"/>
            <output expression="&quot;You have $&quot;&amp;fp&amp;&quot; leftover. Thank you for shopping with us.&quot;" newline="True"/>
        </body>
    </function>
</flowgorithm>
