education.mu
Welcome, Guest. Please login or register.
May 22, 2012, 08:18:42 PM

Login with username, password and session length
Search:     Advanced search
Welcome to the free discussion forum. Ask your questions and we shall answer you immediately. Everyday new notes are added on the forum.
988 Posts in 592 Topics by 4706 Members
Latest Member: Sameerchand2012
* Home Help Search Calendar Login Register
+  education.mu
|-+  SC (FIV - FV)
| |-+  Computer Studies
| | |-+  Help with Algorithm and Pseudo Codes
« previous next »
Pages: [1] Go Down Print
Author Topic: Help with Algorithm and Pseudo Codes  (Read 1292 times)
creatively12
Newbie
*
Offline Offline

Posts: 2


« on: April 15, 2009, 03:19:26 AM »

Hello, my name is faizan and i need help with Algorithm and Pseudo Codes  as urgently and immedietly as possible

Thank You for your assistance
Logged
hoshila
Administrator
Newbie
*****
Offline Offline

Posts: 6



« Reply #1 on: April 24, 2009, 02:42:33 PM »

Algorithm - Well-defined instructions that perform some tasks and stops in finite time
How to represent algorithms?
1.   Use natural languages
   too verbose
   too "context-sensitive"- relies on experience of reader
2.   Use formal programming languages
        too low level
   requires us to deal with complicated syntax of programming language
3.   Pseudo-Code - natural language constructs modeled to look like statements available in many programming languages

Pseudo-Code is simply a numbered list of instructions to perform some task.
Example - Computing Weekly Wages: Gross pay depends on the pay rate and the number of hours worked per week. However, if you work more than 40 hours, you get paid time-and-a-half for all hours worked over 40. Pseudo-code the task of computing gross pay given pay rate and hours worked.
1.         get hours worked
2.         get pay rate
3.         if hours worked ≤ 40 then
            3.1       gross pay = pay rate times hours worked
4.         else
            4.1       gross pay = pay rate times 40 plus 1.5 times pay rate times (hours worked minus 40)
5.         display gross pay
6.         halt
 
            variables:  hours worked, ray rate, gross pay
This example introduces the conditional control structure. On the basis of the true/false question asked in line 3, we execute line 3.1 if the answer is True; otherwise if the answer is False we execute the lines subordinate to line 4 (i.e. line 4.1). In both cases we resume the pseudo-code at line 5.

http://userpages.wittenberg.edu/bshelburne/Comp150/Algorithms.htm
« Last Edit: April 24, 2009, 11:31:19 PM by Tutor » Logged

Shanila
creatively12
Newbie
*
Offline Offline

Posts: 2


« Reply #2 on: April 24, 2009, 09:34:54 PM »

Thanx for the help, really appreciate it  Smiley
« Last Edit: April 24, 2009, 11:31:34 PM by Tutor » Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!