Checking flowcharts with decision points for haircut and letter writing

  • Thread starter Thread starter jai6638
  • Start date Start date
  • Tags Tags
    Homework
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 3K views
jai6638
Messages
263
Reaction score
0
hey.. taking a Intro-to-programming course and have to do 2 flocharts for homework. ( i need to include a decision in each flowchart ) . i'd apprecate it if someone could tell me if what i have done is correct or not..

!) Draw a flowchart to get a haircut

Start
Get in Car
drive to hairdresser
Tell barber to cut hair in a style of your choice
Sit on a chair and let barber cut your hair.

Decision:

Is barber is done cutting hair

No:

Kepe sitting ... Link to the flowline between "sit on a chair and let barber cut your hair" and decision box.

yes :

pay the barber

get in car and drive home

Stop
_____________________________________________________

2) Writing a letter:

Start
Take pen and sheet of paper
Write a rough draft of the letter

Decision:

Is the rough draft framed well ?

No:

review rough draft and make appropriate changes ( and then link this to the flowline between "write a rough draft of the letter" and the decision" )

Yes:

Make the final copy from the rough draft

Stop

________________________________________________________





thanks
 
Physics news on Phys.org
The description is OK. In the first case say that the customer can wait for a short interval of time while his hair is being cut, till we go to the decision diamond again. Otherwise it seems like an event driven algorithm.

Do you have your activity diagrams to show us?
 
doesnt "Sit on a chair and let barber cut your hair." technically mean the same as "wait for a short interval of time ..." ... or are you saying that i should replace the former with the latter?


wht do u mean by activity diagrams? I don't have a scanner to scan the flowcharts that i have prepared..

thanks much!
 
Well, because flowcharts show a sequence of well defined steps in an algorithm, 'stay sit on the chair and wait' is not a definite action. You could just mention an interval of time such as 5 seconds.
By activity diagrams I just mean the flowcharts (UML term for flowcharts).