thepapercup
New member
- Joined
- Sep 7, 2008
- Messages
- 9
Well, I'm only in my math class for half an hour every day and I've hit a bump in the road with my homework.
I'm just not sure what a "decision" or a "loop" is when it comes to algorithms. Could somebody help me out?
I'll type up the problem:
The key steps of an algorithm for filling your car with gas at a self-service pump are out of order. Put these steps in the correct order.
A. Place hose nozzle in gas pipe of car.
B. Turn on pump by lifting lever below hanger.
C. Pay cashier for the amount of gas you pumped.
D. Take nozzle off its hanger on pump.
E. If station requires a deposit before pumping, pay deposit.
F. Squeeze nozzle handle to pump; stops automatically.
Answer: E,D,B,A,F,C
((Here's where I need help))
Is there a decision in the algorithm above? If there is, which step involves the decision? Is there a loop in the algorithm above? If there is, describe the loop.
Hope somebody can help me out soon. >.< It's due tomorrow.
I'm just not sure what a "decision" or a "loop" is when it comes to algorithms. Could somebody help me out?
I'll type up the problem:
The key steps of an algorithm for filling your car with gas at a self-service pump are out of order. Put these steps in the correct order.
A. Place hose nozzle in gas pipe of car.
B. Turn on pump by lifting lever below hanger.
C. Pay cashier for the amount of gas you pumped.
D. Take nozzle off its hanger on pump.
E. If station requires a deposit before pumping, pay deposit.
F. Squeeze nozzle handle to pump; stops automatically.
Answer: E,D,B,A,F,C
((Here's where I need help))
Is there a decision in the algorithm above? If there is, which step involves the decision? Is there a loop in the algorithm above? If there is, describe the loop.
Hope somebody can help me out soon. >.< It's due tomorrow.