moneeba anwar

18
*APPLICATION OF LIMITS IN SOFTWARE ENGINEERING. Group members: *Moneeba Anwar. *Romaisa waheed. *aimal khan.

Upload: moneeba-anwar

Post on 07-Aug-2015

61 views

Category:

Engineering


1 download

TRANSCRIPT

*APPLICATION OF LIMITS IN SOFTWARE ENGINEERING.

Group members:*Moneeba Anwar.*Romaisa waheed.*aimal khan.

KEY POINTS IN PRESENTATION limits in switch statement. limits in loops. limits in if else statement. limits in arrays. limits in classes. memory limits in windows. pc time limits and algorithm stability.

limits in over flow under flow .

INTRODUCTION TO LIMITS.

definition:A point or a level beyond which something does not exceed .

0r limit of f(x) is such that x approaches a is l.

limitx->af(x)=l.

The limit of f(x) as x approaches a is L

EXPLANATION OF LIMITS.

• The limit of the function shows the behavior of the function when the value in domain f(x) either become very small or very large.

• A limit describes the behavior of a dependent variable when its independent variable takes extreme values.

EXAMPLES OF LIMITS.

• lets consider this function : y = 1/x. As you know, this typical function is not defined at x = 0 because the division by zero is not admitted in real numbers. Therefore we cannot compute the value of y when x = 0. However, we can observe how the function behaves near x = 0 : this is the concept of limit. Lets see how this function behaves when x approaches zero from the right: limx->0+ 1/x = infinity.

• we uses limit in speed as time approaches to zero .the formula is shown as

v t0 = distance /time.Which is called “instantaneous velocity” .

+

Applications of limits

LIMITS IN SWITCH STATEMENT.

• In switch we use cases which limitize the user to use either one of any case.

A

so in this way we can use limits in switch statements to solve programing problems.

LIMITS IN LOOP.• The use of limits in for loop• for(i=0;i<=10;i++)

{ cout<<“.”;}• It limitize the value of i to 10. Reaching

the 7th iteration the loop wont execute.

LIMITS IN IF ELSE STATEMENT.IN IF ELSE STATEMENTS WE USE THE CODING IN SUCH A LIMITING MANNER THAT BEFORE THE EXECUTION THE COMPILER CHECKS THE

GIVEN LIMIT ACCORDING TO WHICH IT EXECUTES THE RELEVANT CODE.

LIMITS IN ARRAYS.IN PROGRAMMING ARRAYS ALSO USES LIMITS.

THE LIMITS IN ARRAYS IS DECLARED AT THE TIME OF ITS DECLARATION.

THE ARRAY DO NOT EXCEPT ANY FURTHER VALUE THAT EXCEEDS ITS INDEX AND THE

COMPILER SHOWS IT AS AN ERROR .

LIMITS IN CLASSES• In classes the data is classified in two types.”

• “Private data” and “public data”.

• The private data is limited for its access only for the data and all types of functions with in the class , no data from outside the class can access the private data.

• While public data and functions are accessible for all types of data inside as well as outside the class.

MEMORY LIMITS IN WINDOWS.

• When building and running an application under Windows*, you need to be aware of the limitations on the size of code and data your program can declare and use. 

• 64-bit applications will not run on a 32-bit variant of Windows.

• This process happens according to the limited space which the window has occupied data types used in the application for example an integer can store up to “2 bytes” ,float “4 bytes” and char “1byte”.

PC TIME LIMIT.

• By putting the time limit on pc you can prevent a child from excessive use of computer.

• PC Time Limit Pro, lets you specify when exactly and how long the computer can be used and define users which will be allowed to use the computer within that specific time limit.

ALGORITHM STABILITY• A finite sequence of rules for performing computation in a computer such that at each instant the rules determine what a program has to do next.

• These rules include a “stopping rule” that makes the computer stop so it cannot run on indefinitely

• Stability:• An algorithm should be stable.that is small change in the initial data should give small change in the final result. If it doesn’t the program is unstable.

OVER FLOW UNDER FLOW IN UNSIGNED

DATA TYPES• Underflow will cause the calculation result to zero and overflow will not be compiled by the compiler and it will show error messages.

• Following are the limitations of different unsigned data types .

• Integer “o” (min) , “2147483648” ( Max ).

• Char “0”(MIN) , “255” (MAX).

EXAMPLE :-• Suppose we have 2 unsigned integer types each

of value of “2147483648 “

• “A“ and “b” and we add them a+ b = 4294967296 which is larger them the max limited value that can be represented by an unsigned integer .

• So this is called “integer overflow” .

• Now we see another example .

• Unsigned integer a , b ;

• A=0;

• B=a-1;

• The value of b is -1 which is below the minimum value that can be stored . So this is called “integer underflow”.

The end…….!!!!