Sie sind auf Seite 1von 24

HND IN COMPUTING & SYSTEM DEVELOPMENT

Acknowledgment

I am specially thanking to my helpful lecturer, Miss: S.Neelanjalee the supervision and support that he
gave truly help the progression and smoothness of the internship program. The co-operation is much
indeed appreciated. A big contribution and hard worked from both of you during this period is very great
indeed. All assignment during the program would be nothing without the dedication and thoughts from
you. As well, this position program makes me realize the value of working new experience in working
environment, which challenges us every minute. The whole program really brought us together to
appreciate the true value of friendship and respect of each other.

VENUGA RAJENDRAN
HND IN COMPUTING & SYSTEM DEVELOPMENT
BATCH NO:-VIII

R.VENUGA Procedural Programming Page 1


HND IN COMPUTING & SYSTEM DEVELOPMENT

Introduction to C++
A C + + program is a collection of commands that tell the computer to "do something" to do. This
collection of commands is usually called C + + source code, source code or just code. Commands are
"functions" or “keywords". Keywords are a basic building block of the language, while functions are, in
fact, usually written in terms of simpler functions - which you will see in our first program below.
(Confused Consider it a bit like an outline for a book? Circumference would show each chapter in the
book, each chapter had its own list, composed of sections, each section would have its own list, or it
could be all of them. Written information.) Fortunately, C + + provides many common functions and
keywords that you can use.

Advantages of C++

1. Vendor-neutral:. The C + + standard is the same in any platform or compiler


2. Industrial (as opposed to academic). Become the needs of software engineers, computer
scientists do not meet
3. Efficient. Compiles into highly optimized CPU-specific machine code with little or no runtime
overhead.
4. Multi-paradigms. Allows the use and mixing of procedural, OOP, generic programming,
functional programming, etc. without penalty
5. C + + is relatively low and is a systems programming language.
6. It has a great community.
7. It has a fairly clear and mature standard

Disadvantages of C++

1. C + + classes, and is therefore functions with the same name (and overloaded functions) says
symbol mangling System.
2. The concept of "undefined behavior" (as well as C), - a large class of errors that either compiler
or the runtime system is required to diagnose.
3. Has some design flaws, though they are largely determined by the boost libraries and the new
language standard.
4. Missing network and asynchronous I / O, graphics, concurrency, serialization, and many other
facilities expected of modern languages, though that fixed by the boost libraries and (as far as
concurrency is concerned) is largely the new language standard.
5. Unorthodox syntax is used in the determination of facilities such lamas and templates (although
still very usable).
6. It can generally be tough if not careful.

R.VENUGA Procedural Programming Page 2


HND IN COMPUTING & SYSTEM DEVELOPMENT

Task 1

1.1 A Pseudo code and Flow Chart for the problem.

Introduction to algorithm
An algorithm is a procedure or formula for solving a problem. The word is derived from the name of the
mathematician Muhammad ibn Musa al-Khwarizmi, which is a part of the royal court in Baghdad and
who lived from about 780-850. Al-Khwarizmi's work is the likely source for the word algebra.

A computer program may be seen as an extended algorithm. In mathematics and computer science, an
algorithm usually means a small procedure that solves a recurrent problem

Algorithm types I will consider include:

 Simple recursive algorithms


 Backtracking algorithms
 Divide and conquer algorithms
 Dynamic programming algorithms
 Greedy algorithms
 Branch and bound algorithms
 Brute force algorithms
 Randomized algorithms

What is a Pseudo code?


Pseudo code is a detailed yet readable description of what a computer program or algorithm must do,
expressed in a formal style natural language rather than a programming language. Pseudo code is
sometimes used as a detailed step in the development of a program. This leads designers or programmers
to design pressures in detail, and provides a detailed programmers template for the next step of writing
code in a specific programming

R.VENUGA Procedural Programming Page 3


HND IN COMPUTING & SYSTEM DEVELOPMENT
Notations of Pseudo code
A
Symbol English Explanation Java Equivalent L TEX
a b \gets" assign to a the value of b = \gets
a ^ b \and" takes the logical and of a and b && \wedge
a _ b \or" takes the logical or of a and b jj \vee
:a \not" takes the negation of a ! \neg
a = b \is equal to" determines whether a is equal to == =
B
a =6 b \is not equal to" determines whether a is not equal != \neq
to b
a<b \is less than" determines whether a is less than < <
B
ab \is less than or determines whether a is less than <= \leq
equal to" or equal to b
a>b \is greater than" determines whether a is greater > >
than b
ab \is greater than or determines whether a is greater >= \geq
equal to" than or equal to b
ab \approximately" symbolizes that a is approxi- N/A \approx
mately equal to b
Dae \ceiling" yields the smallest integer greater N/A \lceil,\rceil
than or equal to a
Bac \ oor" yields the largest integer less than N/A \lfloor,\rfloor
or equal to a
a 2 A \element of" a is an element of the set A N/A \in
A B \subset" the set A is a subset of the set B N/A \subseteq
A B \proper subset" the set A is a proper subset of the N/A \subset
set B

Pseudo cord for Prime No


Start
input N
if N<1 then
display “NOT REAL NO”
else
for X=2 to sqrt (N) do
if N mod X =0 then
display “NOT PRIME”
break loop
end if
end do
if loop fully repeated then
display “PRIME NO”
end if
end if
stop.

R.VENUGA Procedural Programming Page 4


HND IN COMPUTING & SYSTEM DEVELOPMENT

What is flow chart?


A flow diagram is a diagram that describes a process or treatment. It includes several steps, making the
process "flows" through from start to finish. Common uses for flowcharts include the development of
business plans, define troubleshooting steps, and the design of mathematical algorithms. Some
flowcharts, only a few steps, while others can be very complex, with hundreds of possible outcomes.

Flowcharts typically use standard symbols to represent different stages or activities within the chart. Thus
each step shown within a rectangle, and every decision is a diamond. Arrows between the different
symbols set to the direction of the process flow showing. While flowcharts can be created with a pen and
paper, there are several software programs available that make designing flowcharts particularly easy.
Common programs that can be used to flowcharts include Smart Draw and Visio for Windows and Omni
raffle for Mac

Notations of Flow chart

Symbols Name Functions

An oval represents a start or


Start / end
end point
A Line is a connected that
Arrows shows relationships between
the representative shapes

A parallelogram represents
Input / Output
input or output

A rectangle represents a
Process
process

A diamond indicates a
Decision
decision

R.VENUGA Procedural Programming Page 5


HND IN COMPUTING & SYSTEM DEVELOPMENT
Flow chart for Prime No

Start

Input N

P=0, I=2

Yes
N<
1?

No
num=sqrt(N)
Print “Not valid”

I<=num
No
I=I+1
Yes

N mod
No I=0?
Yes

P=1

No
P=1
?
Yes

Print “Prime” Print “Not Prime”

Stop

R.VENUGA Procedural Programming Page 6


HND IN COMPUTING & SYSTEM DEVELOPMENT
1.2

C++ Code for Prime number

#include <iostream>
using namespace std; //using namespace system;
int isPrime(long num) // Returns 1 (true) if its prime, or 0 (false) if not
{
if (num < 2) // 1 is not a prime number
return 0; // if it is > 2 and an even number,prime
if (num > 2 && (num % 2) == 0)
return 0; //considering the fact all can be divided by 1 and itself,
for(int i = 2; i < num; i++ )
{
cout << " divisor: " << i << endl; // if it is divisible by i
if ( (num % i) == 0) // a divisor other than 1 and the number itself
{
return 0; // no need for further checking
}
}
return 0; // if all hurdles/checks are crossed, heyyyy, its a prime
}
int main()
{
int num;
do {
cout << " enter a number (0 to stop) " << endl;
cin >> num;
if (num) {
if (isPrime(num))
cout << num << " is a prime number " << endl;
else
cout << num << " is NOT a prime numebr " << endl;
}
} while (num > 0);

return 0;
}

R.VENUGA Procedural Programming Page 7


HND IN COMPUTING & SYSTEM DEVELOPMENT
1.3

Input/output Screen

Input

R.VENUGA Procedural Programming Page 8


HND IN COMPUTING & SYSTEM DEVELOPMENT

Output

R.VENUGA Procedural Programming Page 9


HND IN COMPUTING & SYSTEM DEVELOPMENT
1.4 Provide suitable Test Cases.

Introduction to Test cases

Test cases: Inputs to test the system and the predicted outputs from these inputs if the system operates
according to its specification.

Test data: Inputs which have been devised to test the system

Test-to-pass and test-to-fail


• Test-to-pass:

• Assures that the software minimally works,

• Does not push the capabilities of the software,

• Applies simple and straightforward test cases,

• Does not try to “break” the program.

• Test-to-fail:

• Designing and running test cases with the sole purpose of breaking the software.
• Strategically chosen test cases to probe for common weaknesses in the software

Test cases 1
Test cases 1
Purpose
To test entering real numbers
Test data 0
Output Invalid Number

Output: - As expected Result

R.VENUGA Procedural Programming Page 10


HND IN COMPUTING & SYSTEM DEVELOPMENT
Test cases 2

Test cases 2
Purpose
To test entering Prime numbers
Test data 5,7,11
Output This is the prime number

Output:-As expected Result

Test 3
Test cases 3
Purpose
To test entering not Prime numbers
Test data 8
Output This is not prime number

Output:- As expected Result

R.VENUGA Procedural Programming Page 11


HND IN COMPUTING & SYSTEM DEVELOPMENT
1.5 An explanation of the difference between syntax and semantic errors. Explain
based on an example from the developed program

Syntax errors
A syntax error is an error in the source code of a program. Since computer programs strict syntax to be
followed to compile certain aspects of the code that do not comply with the syntax of the programming
language will produce a syntax error.

Unlike logical errors, the errors in the flow of the logic of a program, syntax errors are minor
grammatical errors, sometimes limited to a single character. For example, a missing semicolon at the end
of a line or an additional bracket at the end of a function can lead to a syntax error. The PHP code below,
the second closed bracket would result in a syntax error because there are only open containers in the
position.

R.VENUGA Procedural Programming Page 12


HND IN COMPUTING & SYSTEM DEVELOPMENT
Semantic errors
These are valid code understands the compiler, but they do not know what you, the programmer intended.
It may involve the use of the wrong variable, wrong operation or operations in the wrong order. There is
no way be detected. For the compiler.

In programming, writing a valid programming structure with invalid logic. The compiler will generate
instructions that the computer will perform, because it understands the syntax of programming
statements, but the output is incorrect.

R.VENUGA Procedural Programming Page 13


HND IN COMPUTING & SYSTEM DEVELOPMENT
Task 2

2.1

2.2 User Manual

Introduction to user manual


The manual contains all the essential information for the user full use of the information to. This manual
contains a description of the system features and capabilities, risks, and alternative ways of working, and
step-by-step procedures for system access and use. Use graphics whenever possible iii this manual. The
manual format can be changed if another format is more suitable for the particular project.

Download the C-Free software from Internet

Install the C-Free software

Screen 1

Screen 2

R.VENUGA Procedural Programming Page 14


HND IN COMPUTING & SYSTEM DEVELOPMENT

Screen 3

Screen 4

R.VENUGA Procedural Programming Page 15


HND IN COMPUTING & SYSTEM DEVELOPMENT
Screen 5

R.VENUGA Procedural Programming Page 16


HND IN COMPUTING & SYSTEM DEVELOPMENT
2.3 Test Cases

2.4 Evaluate the system techniques

Array
An array in C programming language may be defined as the number of memory locations, each storing
the same data type, and which can be found by the same variable.

An array is a collective name for a group of similar quantities. These similar quantities could be
percentage marks of 100 students, the number of seats in the house, or the salaries of 300 employees or
age of 25 students. For example, an array is a collection of similar elements. These similar elements
could be all integers or all floats or all characters, etc. Usually, the set of characters that a "string", where
an array of integers or floats is called simply an array. All elements of a given array must be of the same
type, so we can have a set of 10 songs, of which 5 inks and 5 are floats not.

Loop
A loop is a way of repeating a statement a number of times until one way or another from the termination
of the loop occurs. It can be performed for a preset number of times, usually repeated in a loop as long as
an expression is true (a while loop) or repeated until an expression is false in a do while loop.

With the aid of a label, a go to statement can also be made by jumping backward to a label, a loop, but
this is generally not recommended as a poor programming practice. For some complex code thus a jump
to a common output that simplifies the code.

R.VENUGA Procedural Programming Page 17


HND IN COMPUTING & SYSTEM DEVELOPMENT
Types of loops

 For loop
 While loop
 Do-while loop

For loop
Syntax:-

For (Start value; end condition; increase value)

Statement(s);

While Loop
A while loop statement in C programming repeatedly performs a purpose statement, as long as a
specified condition is true.

While (condition) {to carry out code while the condition is true} The true is a Boolean expression that x
== 1 or while it could be (x! = 7) (x is not equal to 7). It can be any combination of Boolean statements
that are his legally. Even, (while x == 5 || v == 7) which says enter the code while x equals five or while v
equals 7 Note that a while loop is like a stripped down version of a for loop - it has no initialization or
update. However, an empty state is not legal for a while loop as it is with a loop.

Syntax: - The syntax of a while loop in C programming language is:

While (condition)
{
Statement(s);
}

Do-while loop
Syntax:-
Do
{
do something;
}
While (expression);

R.VENUGA Procedural Programming Page 18


HND IN COMPUTING & SYSTEM DEVELOPMENT
Selection statement

If Selection Statement

Programs use selection to choose between alternative courses of action. Statements For example, the
passing grade on an exam is 60 The statement

If (grade> = 60)

cout << "Passed";

Determines whether the fitness value> = 60 is true or false. If it is true, "Passed" is printed and the next
statement is executed in order. If the condition is false, printing ignored and the following declaration is
executed. Note that the second line of the selection theory is indented. Such indentation is optional, but
recommended.

If else if Selection Statement

An if statement can be followed by an optional else statement, which executes when the Boolean
expression is false.

Syntax:-
if ( expression )
statement1
[else
statement2]

Nested if selection statement

It is always legal to nest if-else statements, which means you can use one if or else if statement inside
another if or else if statement.

Syntax:-

If (boolean_expression 1)

// Executes when the boolean expression 1 is true

If (boolean_expression 2)

// Executes when the boolean expression 2 is true

R.VENUGA Procedural Programming Page 19


HND IN COMPUTING & SYSTEM DEVELOPMENT

Limitation of develop program

R.VENUGA Procedural Programming Page 20


HND IN COMPUTING & SYSTEM DEVELOPMENT
Task 3

Manual System
A System that does not use. Each computer devices All data would be stored in other ways, especially
paper. As a few examples: Before the accounts, payroll and spreadsheet applications, people would have
this kind of detailed information on paper. People would handwritten letters or have used typewriters
instead of word processors. Graphs and charts should be drawn by hand instead of using computer
software to do them.

A system in which data processing that does not make use of stored program Or computer that is
controlled or manipulated by a human operator or driven by muscular strength using an electric motor or
engine. This system is only dependent on manpower.

Problems in the manual system


Slow retrieval of data - The data are stored in different clients parts of the site and take a long time to
retrieve the data. With all can take to 30 minutes to find the relevant information about the person .the
Delivery starts from the next day . Deliveries are sometimes kept as a result of the amount of taken the
time to get the relevant information. This leads to unhappy customers

Waste Paper - Lots of paper waste due to the number of customers in the company . Information on each
of the orders is stored in the file of the customer another page .

Unproductive use of storage space - Paper takes an enormous amount of space in the site. If a computer
system will be purchased paper can all go and there would be a lot more space which can be used for
other purposes.

Poor Data Storage - All data is stored in filing cabinets . Data can be out of place due to human error or
in the event of an interruption in the data , and may be very easily stolen .

Poor Customer / Client Service - availability of information

R.VENUGA Procedural Programming Page 21


HND IN COMPUTING & SYSTEM DEVELOPMENT
Disadvantages of manual system

 It is much more time-consuming.


 Often the books are lost and the is not aware.
 No proper records for the workers, members and books transaction.
 If manual booklet lost data is completely lost.
 Many Manual is required for tracking.
 The employees mostly sweepers and security guards are often absent and takes the salary for the
whole month without justification of their presence.
 Many a times duplication occurs when employees find it difficult to keep hold. In bundles of
records
 The data is stored in filling cabinets and can be in the wrong hands and be used against the
company.
 Data is not always as reliable as it is written by hand and some human errors occurred eg wrong
phone ECT.
 Collecting data is very slow when it needs to be to be found in a variety of registers and waste a
lot of time sought.
 Most data is stored in the registers and these are stored in filing cabinets and this takes a lot of
space.

Solution

Computerized system
An automated system is a computer system with a purpose. When we talk about a computer, we simply
refer to the hardware and software that comprise the computer system. But if we have an automated
system, we are talking about a function (manufacturing or processing) integrated with a computer system
and executed by trained people.

There are two major components of a computer system:

1. The computer that the function ( process or operation ) controls


2. The function ( or processing operation ) which is controlled by the computer system

The controlling computer system consists of hardware and software, but in the case of cloud computing,
the computer consists of virtual hardware (virtual machine ) and software (system and application ) .
Monitored function consists of equipment are checked and operational procedures performed by trained
people. In some cases, the function cannot be controlled equipment other than the operation of the
computer system in which the controlled function in order completely out of operation procedures ( the
computer system ) is performed by trained individuals .

R.VENUGA Procedural Programming Page 22


HND IN COMPUTING & SYSTEM DEVELOPMENT
Advantages of Computerized system
• Computers can make calculations quickly and effectively.

• They use less space.

• Data can be quickly and easily retrieved

• Safety is to break into tight and hard

• Documents can be retrieved lost.

• Documents can be retrieved lost.

• Errors and changes can be easily corrected

• Long-term cost savings for the organization, as the handiwork of to the contact may be replaced by the
computer system.

• Fast processing time.

Future recommendation

R.VENUGA Procedural Programming Page 23


HND IN COMPUTING & SYSTEM DEVELOPMENT
Harvard References

What is algorithm? - Definition from WhatIs.com. 2014. What is algorithm? - Definition from
WhatIs.com. [ONLINE] Available at:http://whatis.techtarget.com/definition/algorithm. [Accessed 05
July 2014].

What is pseudocode? - Definition from WhatIs.com. 2014. What is pseudocode? - Definition from
WhatIs.com. [ONLINE] Available at:http://whatis.techtarget.com/definition/pseudocode. [Accessed 05
July 2014].

2014. . [ONLINE] Available at: http://cs16.net/info/reference.pdf . [Accessed 06 September 2014].

C++ nested if statements. 2014. C++ nested if statements. [ONLINE] Available


at: http://www.tutorialspoint.com/cplusplus/cpp_nested_if.htm . [Accessed 07 September 2014].

C++ for loops, while loops | CodingUnit Programming Tutorials. 2014. C++ for loops, while loops |
CodingUnit Programming Tutorials. [ONLINE] Available at:http://www.codingunit.com/cplusplus-
tutorial-for-loops-while-loops . [Accessed 07 September 2014].

Google. 2014. Google. [ONLINE] Available


at: https://www.google.lk/?gws_rd=cr,ssl&ei=Re8LVIaQH5aSuASY1oKQAg#q=definition+of+nested+i
f+selection+statement+in+c%2B%2B . [Accessed 07 September 2014].

R.VENUGA Procedural Programming Page 24

Das könnte Ihnen auch gefallen