Click to See Complete Forum and Search --> : algorithm help
ghostrider_84
December 30th, 2007, 09:47 PM
hey guyz...am new to this forum and also programmin
i have an assignment due on jan 3rd...its jss an algorithm...i hope someone can help me...
the algorithm is...
In English, provide a detailed algorithm to make a phone call (make sure you handle various situations such as busy signal, no answer, etc.).
thanx to anyone who helps...thanx for welcomin me into this forum
mgately
December 30th, 2007, 10:11 PM
Is this assignment for a introduction to programming class?
From what you have said, I think the point of your assignment is getting you to think about everything that would be involved making a phone call.
So consider for example your assignment was to design an algorithm to make a sandwich.
A simple algorithm would be
Step 1: Gather Food
Step 2: Make Sandwich
Step 3: Put Food Away
Now if you want a more detailed algorithm (because if this was something to do with programming, that wouldn't be nearly enough to make the program work) the following algorithm would be better.
Step 1: Get bread out. If there is no bread purchase it from the local store.
Step 2: Get meat and cheese out. If there is no meat and cheese purchase it from the local store.
Step 3: Get mayo out. If there is no mayo purchase it from the local store.
Step 4. Take a slice of bread and a knife, spread mayo on bread.
Step 5. Place meat and cheese on bread. Place a second slice of bread to complete the sandwich.
Step 6: Put all food away.
Does this help you understand what you are doing?
ghostrider_84
December 30th, 2007, 10:26 PM
i got u man...u made it understandable...i have a small question though...since the question says provide in detailed in english...do i have to write in the form of steps or the basic algorithm with all the boxes
TheCPUWizard
December 30th, 2007, 10:32 PM
i got u man...u made it understandable...i have a small question though...since the question says provide in detailed in english...do i have to write in the form of steps or the basic algorithm with all the boxes
Only your professor know that he/she wants....
You should have read the assignment, made sure you understood it, and asked any questions before (I am assuming) your school took the holiday break.
Sorry, but we are NOT mind readers.
mgately
December 30th, 2007, 10:45 PM
TheCPUWizard is right, only your professor can tell you exactly what you are supposed to turn in, though I get the feeling that this is probably an assignment due before your first class. If it is, detailed English probably means they want you to explain each step (get out bread, get out meat, and so on) in easy to understand english. So in otherwords anyone picking up your instructions would be able to place a phone call. Whether you use steps, or boxes, it should be readable to anyone.
This is my best guess, good luck with it.
ghostrider_84
December 30th, 2007, 11:25 PM
thanx guy
ghostrider_84
December 31st, 2007, 03:17 PM
guyz this waht i came up with...correct this if its wrong....thanx
step1: search for the number in address book, pickup phone
step2: listen the dialtone, dial the number,listen for a phone response
step3: if call answered talk
else busy signal go to step 4 and repeat from step1
else no one answers leave a message and go to step4
step4: hangup
dglienna
December 31st, 2007, 04:38 PM
Break it down a LOT further
step1: search for the number in address book, pickup phone
search for number
if number found
pickup phone
wait for dialtone
dial #
so it's easy to turn into some kind of flow diagram (or flowchart) which would be the next step
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.