i have my algorithm but i can't get the flowchart to come out.

Main()

Declare Sticker_Price as Real



Declare Discount_Percent as Real


Declare Tax_Percent as Real
Declare Tag_Color as Character
Declare Answer as Character
Declare Final_Price as Real
Set Tax_ Percent = 0.07
Final_Price = 0.00

Repeat
    Process Get_Price(Sticker_Price)
    Process Discount(Tag_Color, Discount_Percent)
    Process Calc_Final(Sticker_Price, Tax_Percent, Discount_Percent, Final_Price)
    Repeat
        Print "Do you want to enter another item (y,n)"
        Input Answer


        If Answer != 'y' or 'n'
                Print "That letter is invalid"
                End If
        Until Answer == ‘y’ or ‘n’
Until Answer == 'n'
    Print "The total is $" + Final_Price
End

Get_Price(Price as Real&)
    Repeat
        Print "Enter sticker price of item"
        Input Price
        If Price <0.01
            Print "Please enter a price greater than $0.00"
        End if
    Until Price >0.00
Exit



Discount(Tag_Color as Character, Discount_Percent as Real&)


    Repeat


    Print "Enter the first letter of the sales tag color as UPPERCASE (W - B - O - R)"
    Input Tag_Color
    Case of Tag_Color:
        = 'W':
            Discount_Percent = 0.00
        = 'B':
            Discount_Percent = 0.25
        = 'O':


                Discount_Percent = 0.50
            = 'R':
                Discount_Percent = 0.75
            Otherwise
                Print "That is a invalid tag color"
                Discount_Percent = -1
        End of Case
    Until Discount_Percent != -1
Exit

Calc_Final(Sticker_Price as Real, Tax_Percent as Real, Discount_Percent as Real, Final_Price as Real&)
    Declare Item_Price as Real
    Declare Discount_Amount as Real
    Declare Tax_Amount as Real
    Discount_Amount = Sticker_Price * Discount_Percent
    Tax_Amount = Sticker_Price * Tax_Percent
    Discount_Price = Sticker_Price - Discount_Amount
    Item_Price = Discount_Price + Tax_Amount
    Print "The Item price is $" + Item_Price + "that is with $" + Tax_Amount + "and a $" +
    Discount_Amount + "Discount"
Final_Price = Final_Price + Item_Price
Exit

Recommended Answers

All 4 Replies

i have my algorithm but i can't get the flowchart to come out.

What does that mean? Are you using a program to create a flow chart for you?

Anyway, here are my observations...

1) Line 15, shouldn't it be Set Final_Price = 0.00?
2) Lines 18, 19, and 20, do you really expect to pass variable by references? It is uncommon practice in this case for what you are dong (common practice: prefer a returned value from the function instead).

i thought he wants to convert the program to a flowchat

Oh? Then it is easy, but I am not going to do it for him. :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.