Systems Design:
In this phase we start design of proposed new system.It describes desired features and operations in detail, including screen layouts, business rules, process diagrams, pseudo code and other documentation. We can use two designing methods namely logical (what is required for IS) and physical (how to achieve requirements). At first we design logical and then it is converted into physical design. A prototype should be developed during the logical design phase if possible. The detailed design phase modifies the logical design and produces a final detailed design, which includes technology choices, specifies a system architecture, meets all system goals for performance, and still has all of the application functionality and behavior specified in the logical design.
This design can carry following activities:
Defining precisely the required system output
Determining the data requirement for producing the output
Determining the medium and format of files and databases
Devising processing methods and use of software to produce output
Determine the methods of data capture and data input
Designing Input forms
Designing Codification Schemes
Detailed manual procedures
Documenting the Design
We can use several tools while designing. They are: Algorithm, Flowchart, Pseudocode, etc. Let’s see in detail about these all designing tools.
1.Algorithm:
This is the first step or a tool which we apply while designing the system. It says about sequence of finite steps written in certain order manually by programmers to carry out job. While writing algorithm, we follow or use general English words which we use in our daily life. There is no particular rule for that. Mostly, it uses 4 units namely inputs, processes, storing and output. Let’s see an example to be clear.
General features of Algorithm:
· Clear specification of input
· Uses variables
· Provides clear steps, processes, controls and specifications.
· Uses subroutines.
Rules for algorithms:
1. Finiteness
2. Input if needed with processes should be shown
3. Very simple language should be used
4. The writer while writing algorithm should be keep in mind about program to be written after this.
Examples:-
1.An algorithm to get sum of two numbers:
Step 1: start
Step 2: get two numbers say a,b
Step 3: let sum=a+b
Step: 4 print sum
Step 5 stop
Step1: Start
Step 2: Input number as n
Step 3: Use sqrt function to find square root and store it in a
Step 4: Display a
Step 5: Stop
Step1: Start
Step 2: Input length as l
Step 3: Use pow function to find cube and store it in v(we can also use let, v=cube of l)
Step 4: Display v
Step 5: Stop
Step1: Start
Step 2: Input length as l and breadth as b
Step 3: Use a=l*b and p=2(l+b)
Step 4: Display a and p
Step 5: Stop
Step 2: Input initial velocity , time and acceleration as u,t,a
Step 3: Use s=u*t+0.5*a*t*t
Step 4: Display s
Step 5: Stop
6.Algorithm to Calculate area and circumference of a circle
Step1: Start
Step 2: Input radius as r
Step 3: Use a=3.14*r*r and c=2*3.14*r
Step 4: Display a and c
Step 5: Stop
7.Algorithm to convert temperature from Centigrade into Fahrenheit
Step1: Start
Step 2: Input temperature in centigrade as c
Step 3: Use f=1.8*c+32
Step 4: Display f
Step 5: Stop
8.Algorithm to calculate sum of two distances and the distance is measured in terms of feet and inches
Step1: Start
Step 2: Input feet1,feet2,inch1,inch2
Step 3: Use feet3=feet1+feet2 and inch3=inch1+inch2
Step 4: newfeet=inch3/12+feet3 and newinch=inch3 % 12
Step 5: Display newfeet and newinch
Step6: Stop
9.Algorithm to enter number of days and convert it into years, months and days
Step1: Start
Step 2: Input days
Step 3: Divide days by 365 and store it as year(y)
Step 4: Remaining days(rd) by finding remainder of days divide by 365
Step 5: For month(m) divide remaining days (rd) by 30 and take integer part.
Step 6: For days(d) divide rd by 30 and find remainder.
Step 6: Display y , m , d
Step 7 : Stop
-------------------------------------------------------------------------
some examples of control structures:
1.Algorithm to find area and circumference of a real circle
Step1: Start
Step 2: Input radius as r
Step 3: Check, is r>0?
3.1 If yes, calculate area and circumference and display it.
3.2 If no, display “This is not a real circle”.
Step 4: Stop
2.Algorithm to check odd or even
Step1: Start
Step 2: Input number as num
Step 3: Calculate remainder by dividing num by 2
Step 4: Check is rem equal to zero?
4.1 If yes, Display “given number is even”
4.2 If no, Display “given number is odd”
Step 5: Stop
3.Algorithm to check whether the given number is positive, negative or zero.
Step1: Start
Step 2: Input a number as num
Step 3: Check that, is num greater than zero?
3.1 If yes, Display “ given number is positive”
3.2 If no, goto step 4
Step 4: Check that, is num less than zero?
4.1 If yes, Display “ given number is negative”
4.2 If no, Display “given number is zero”
Step 5: Stop
4.Algorithm to check loss or gain
Step1: Start
Step 2: Input sp and cp
Step 3: Check, is sp greater than cp?
3.1 If yes, calculate gain=sp-cp and display gain
3.2 If no, calculate loss=cp-sp and display loss.
Step 4: Stop
5.Algorithm to find the largest and smallest among three different numbers
Step1: Start
Step 2: Input three different numbers as a,b and c
Step 3: Check, is a>b and a>c?
3.1 If yes, Display “First number is largest”
3.2 If no, goto step 4
Step 4: Check is b>a and b>c?
4.1 If yes, Display “Second number is largest”
4.2 If no, Display “ Third number is largest”
Step 5: Check is a<b and a<c?
5.1 If yes, Display “First number is smallest”
5.2 If no, goto step 6
Step 6: Check is b<a and b<c?
6.1 If yes, Display “Second number is smallest”
6.2 If no, Display “Third number is smallest”
Step 7: Stop
6.Algorithm to find middle number among three different numbers
Step1: Start
Step 2: Input three numbers as a,b and c
Step 3: Check, is a<b AND a>c OR a>b AND a<c?
3.1 If yes, Display “First number is middle”
3.2 If no, go to step 4
Step 4: Check is b<a AND b>c OR b>a AND b<c?
4.1 If yes, Display “Second number is middle”
4.2 If no, Display “Third number is middle”
Step 5: Stop
7.Algorithm to calculate and display real roots of quadratic equation
Step1: Start
Step 2: Input the value of a , b and c
Step 3: Check, is (b2-4ac)>0?
3.1 If yes, use formula quadratic formula and display the roots
3.2 If no, Display “Sorry, we can not calculate real root”
Step 4: Stop
8.Algorithm to find commission amount
Step1: Start
Step 2: Input sales amount(sa)
Step 3: Check, is sa<1000?
3.1 If yes, calculate and print 5% commission.
3.2 If no, go to step 4
Step 4: Check, is sa>1001 and sa<2000?
4.1 If yes, calculate and print 10% commission.
4.2 If no, calculate and print 12% commission.
Step 5 : Stop
9.Algorithm for menu driven program
Step1: Start
Step 2: Input length(l) and breadth(b)
Step 3: Display menu and Enter your choice
Step 4: Check the user’s choice.
4.1 If the user enters (a) calculate the area of the rectangle and display.
4.2 If the user enters (b) calculate the perimeter and display.
4.3 If the user enters (c) exit from the program.
Step 5 : Stop
10Algorithm to that takes a number less than 10 and displays its multiplication table
Step1: Start
Step 2: Input any number(n)
Step 3: Check, is n<10?
3.1 If yes,
for(i=1;i<=10;i++)
{
Print num*i
}
3.2 If no,
Print “Number is greater than 10”
Step 4 : Stop
--------------------------------------------------------------------------------------
Loop related algorithms:
----------------------------------
1.Algorithm to calculate and display : 1 3 5 …. to 10th terms
Step1: Start
Step 2: Set i = 0 and a=1
Step 3: Check, is i<10?
3.1 If yes, display ‘a’ and calculate a=a+2 and goto step 4
3.2 If no, go to step 5.
STep 4: Calculate i=i+1 and go to step 3
Step 5: Stop
2.Algorithm to display a square series of first ‘n’ natural numbers.
Step1: Start
Step 2: Input a number as n
Step 3: Set i=1
Step 4: Check, is i<=n?
4.1 If yes, Calculate sq=i*i ; Display “ sq ” and goto step 5
4.2 If no, goto step 6
Step 5: Calculate i=i+1 and go to step 4
Step 6: Stop
3.Algorithm to calculate the factorial of any number given by the user
Step1: Start
Step 2: Input a number as n
Step 3: Set f=1,i=1
Step 4: Check, is i <=n?
4.1 If yes, Calculate f=f*i and goto step 5
3.2 If no, goto step 6
Step 5: Calculate i=i+1 and go to step 4
Step 6: Display f
Step 7: Stop
4.Algorithm to calculate and display the multiplication table of a number
Step1: Start
Step 2: Input a number as n
Step 3: Set i=1
Step 4: Check, is i <=10?
4.1 If yes, Calculate and display n*i and goto step 5
3.2 If no, goto step 6
Step 5: Calculate i=i+1 and go to step 4
Step 6: Stop
5.Algorithm to display Fibonacci series having ‘n’ terms
Step 1: Start
Step 2: Set a=0,b=1, i=0
Step 3: Ask the value of ‘n’
Step 4: Is i<n?
4.1 If yes, calculate c=a+b and display “a” . Also set a=b , b=c
4.2 If no, go to step 6
Step 5: Calculate i=i+1 and go to step 4
Step 6: Stop
6.Algorithm to check if a given number is palindrome or not palindrome
Step 1: Start
Step 2: Set sum=0 and ask to enter any number as n
Step 3: Store a=n
Step 4: Is n !=0?
4.1 If yes, calculate r=n%10 , sum=sum*10+r, n=n\10
4.2 If no, go to step 5
Step 5: Is sum = = a?
5.1 If yes, display “ Palindrome number ”
5.2 If no, display “ Not Palindrome number ”
Step 6: Stop
7.Algorithm to calculate sum of given series
Step 1: Start
Step 2: Set sum=0,i=1
Step 3: Ask the value of n
Step 4: Is i<=n?
4.1 If yes, calculate sum=sum+1/i and go to step 5
4.2 If no, go to step 6
Step 5: Calculate i=i+1 and go to step 4
Step 6: Display sum
Step 7: Stop
8.Algorithm to display given output:
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
Step 1: Start
Step 2: Set the outer for loop(i) from 1 to 3
Step 3: Set the inner for loop(j) from 1 to 5
Step 4: Calculate and display i*j
Step 5: Stop
9.Algorithm to check given number is prime or not
Step 1: Start
Step 2: Initialize I=1, count=0
Step 3: Input any number as N
Step 4: Is I<=N?
4.1: If true, Calculate remainder(R) of num divided by I and check, IS R=0?
If yes, calculate count=count+1 and go to step 5
4.2: If false, go to step 6
Step 5: Calculate I=I+1 and go to step 4
Step 6: Is count equal to two.
6.1: If true, Print "Prime"
6.2: If false, Print "Composite"
Step 7: Stop
10.Step 1: Start
Step 2: Input any number as n
Step 3: Set i=1
Step 4: Is i<=n?
4.1: If true, set count=0, Use inner loop(j) as 1 to i
Calculate remainder(R) of i divided by j and
check IS R=0? If yes, calculate count=count+1 and go to step 5
4.2: If false, go to step 6
Step 5: Calculate i=i+1 and go to step 4
Step 6: Is count equal to two.
6.1: If true, Print "Prime"
6.2: If false, go to step 7
Step 7: Stop
-----------------------------------------------------------------------------------------------
Algorithms related to array:
--------------------------------------
1.Algorithm to input marks of five subjects and display the total marks and average marks.
2.Algorithm to read the age of 100 persons and count the number of persons in the age group between 50 to 60 years.