Beruflich Dokumente
Kultur Dokumente
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
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++
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.
Task 1
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
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
A parallelogram represents
Input / Output
input or output
A rectangle represents a
Process
process
A diamond indicates a
Decision
decision
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
Stop
#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;
}
Input/output Screen
Input
Output
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-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
Test cases 2
Purpose
To test entering Prime numbers
Test data 5,7,11
Output This is the prime number
Test 3
Test cases 3
Purpose
To test entering not Prime numbers
Test data 8
Output This is not prime number
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.
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.
2.1
Screen 1
Screen 2
Screen 3
Screen 4
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.
For loop
While loop
Do-while loop
For loop
Syntax:-
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.
While (condition)
{
Statement(s);
}
Do-while loop
Syntax:-
Do
{
do something;
}
While (expression);
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)
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.
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]
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)
If (boolean_expression 2)
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.
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 .
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.
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 .
• Long-term cost savings for the organization, as the handiwork of to the contact may be replaced by the
computer system.
Future recommendation
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].
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].