STRUKTŪRINIS logo Struktūrinis programavimas

Sukurti konsolinę programą C/C++ ir įgyvendinti unikalų realaus gyvenimo algoritmą remiantis šiuo pavyzdžiu http://people.cs.pitt.edu/cs4/:

  • Pastaba! Prieš tai pateikto pavyzdžio rinktis negalima. Temą privalote sugalvoti patys.
  • Aprašyti sugalvotą algoritmą pseudo kodu bei nubrėžti šio algoritmo blokinę schemą.
  • Įvertinti ir realizuoti išimtis, kurios gali nulemti jūsų algortimo veikimą neteisingai.
  • Realizuoti įvedimą iš klaviatūros ir priklausomai nuo pasirinkto punkto algortimo baigtis turi būti skirtinga.
REALAUS GYVENIMO ALGORITMO PAVYZDYS 
**Real Life Algorithms Overview**

Algorithms are precise step-by-step instructions on how to accomplish a desired task. A formal algorithm for use with
 computers or in mathematics must be very detailed and resolve the ambiguities that we take for granted in everyday 
 life. Your first out of class assignment is to pick a common or interesting task and approach it algorithmically, breaking it down to the level that a computer might understand.

 

**Assignment**

For this project you need to pick an everyday or interesting task and create an algorithm that explains how to do it.
- You need to specify what (if anything) is input (like ingredients in a recipe);
- The process by which you operate on that input to produce or accomplish a task;
- What the output of the algorithm is; 
- What (if any) assumptions are made in the algorithm.
 
**What to turn in**

Type your algorithm up using the following example as a template. Name the task your algorithm describes, the input 
and output, and then list the steps involved, numbering each, followed by what your algorithm assumes.

**Example**

**Algorithm:** Calling a friend on the telephone

**Input:** The telephone number of your friend.

**Output:** None

**Steps:**

Pick up the phone and listen for a dial tone
Press each digit of the phone number on the phone
If busy, hang up phone, wait 5 minutes, jump to step 2
If no one answers, leave a message then hang up
If no answering machine, hang up and wait 2 hours, then jump to step 2
Talk to friend
Hang up phone
 
**Assumptions:**

Step 1 assumes that you live alone and no one else could be on the phone.
The algorithm assumes the existence of a working phone and active service.
The algorithm assumes you are not deaf or mute.
The algorithm assumes a normal corded phone.

Turinys paiimtas iš šios svetainės: nuoroda.