0% found this document useful (0 votes)
1K views2 pages

Vending Machine Flowchart

This document outlines the logic for a vending machine program. It describes how the program works: [1] When an item is clicked, the amount is increased by 100; [2] It then checks if the amount is greater than or equal to the price of items A-F, lighting them up if so; [3] If the amount is greater than or equal to the price, the item falls and change is calculated by subtracting the price from the amount.

Uploaded by

api-428117059
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views2 pages

Vending Machine Flowchart

This document outlines the logic for a vending machine program. It describes how the program works: [1] When an item is clicked, the amount is increased by 100; [2] It then checks if the amount is greater than or equal to the price of items A-F, lighting them up if so; [3] If the amount is greater than or equal to the price, the item falls and change is calculated by subtracting the price from the amount.

Uploaded by

api-428117059
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Flowchart 1: Illustrates the initial steps and decision points in the process flow, detailing the beginning of a structured procedure.
  • Flowchart 2: Continues the process flow with further steps and decisions, expanding on the procedural workflow.

Click 100 Baht

Make Variable
Amount

Set
Amount --> Amount + 100

Show Amount

Amount ≥ item A T Item A lights up

T
Amount ≥ item B Item B lights up

T
Amount ≥ item C Item C lights up

T
Amount ≥ item D Item D lights up

Amount ≥ item E T Item E lights up

Amount ≥ item F T Item F lights up

End
When this item is clicked

Set
H --> 0

Set
FT --> 0

Set
TW --> 0

Set
T --> 0

Set
F --> 0

F Show Ask
Amount ≥ Price
"Not enough money" "More money"

Item falls

Set change --> 


Amount - Price

T Set
Change > 99 Change - 100
H --> H + 1

T Set
Change > 49 Change - 50
FT --> FT +1

T Set
Change > 19 Change - 20
TW --> TW + 1

T Set
Change > 9 Change - 10
T --> T + 1

T Set
Change > 4 Change - 5
F --> F + 1

H * 100 FT * 50 TW * 20 T * 10 F*5

End

Click 100 Baht
Set 
Amount --> Amount + 100 
Make Variable 
Amount 
Amount ≥ item A
Item A lights up
Item B lights up
T
F
End
When this item is clicked
Set 
H --> 0 
Set 
FT --> 0 
Set 
T --> 0 
Set 
TW --> 0 
Set 
F --> 0 
Amount ≥ Price
Set change -

You might also like