Posts

COHESION AND COUPLING material

  5.3 COHESION AND COUPLING   ●       We have so far discussed that effective problem decomposition is an important characteristic of a good design. ●       Good module decomposition is indicated through high cohesion of the individual modules and low coupling of the modules with each other. ●       Cohesion is a measure of the functional strength of a module, whereas the coupling between two modules is a measure of the degree of interaction (or interdependence) between the two modules. ●       Coupling: Intuitively, we can think of coupling as follows.   ●       Two modules are said to be highly coupled, if either of the following two situations arise: ●       If the function calls between two modules involve passing large chunks of shared data, the modules are tightly coupled ●     ...

Coding and Testing in software engineering

  ●       Coding is undertaken once the design phase is complete and the design documents have been successfully reviewed. ●       In the coding phase, every module specified in the design document is coded and unit tested. During unit testing, each module is tested in isolation from other modules. ●       After all the modules of a system have been coded and unit tested, the integration and system testing phase is undertaken. ●       Integration and testing of modules is carried out according to an integration plan. ●       The integration plan, according to which different modules are integrated together, usually envisages integration of modules through a number of steps. 10.1 CODING The input to the coding phase is the design document produced at the end of the design phase. The objective of the coding phase is to transform the desi...

Insert delete using Queue in C

 Program #include<stdio.h>    #include<stdlib.h>   void insert();   void dequeue();   void display();   int front = -1, rear = -1 ,maxsize;   int queue[100];   int main ()   {       int choice;        printf("\n Enter the size of QUEUE : ");     scanf("%d",&maxsize);     printf("\n QUEUE OPERATIONS USING ARRAY");     printf("\n1.insert an element\n2.Delete an element\n3.Display the queue\n4.Exit");       while(choice != 4)        {              printf("\nEnter your choice : ");           scanf("%d",&choice);           switch(choice)           {               case 1:             ...

Reflection of triangle|computer graphics|

Image
 Reflection triangle in 2D transformation code #include <conio.h> #include <graphics.h> #include <stdio.h>    // Driver Code void main() {     int gm, gd = DETECT, a,x1,y1,x2,y2,x3,y3;     initgraph(&gd, &gm, "c:\\turboc3\\bgi");     cleardevice();        // Draw the graph     line(getmaxx() / 2, 0, getmaxx() / 2,          getmaxy());     line(0, getmaxy() / 2, getmaxx(), getmaxy() / 2); printf("Enter x1 and y1:\n"); scanf("%d%d",&x1,&y1); printf("Enter x2 and y2"); scanf("%d%d",&x2,&y2); printf("Enter x3 and y3\n"); scanf("%d%d",&x3,&y3);     setcolor(14);     line(x1, y1, x2, y2);     line(x2, y2, x3, y3);     line(x3, y3, x1, y1);///     getch(); printf("Enter 1 for x and 2 for y:\n"); scanf("%d",&a); switch(a){ case 1:     setcolor(3);     line(getma...

COMPOSITE 2D C PROGRAM|Computer graphics|

Image
COMPOSITE 2D TRANSFORMATION code: #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <math.h> int xa,xb,xc,ya,yb,yc,y1a,y1b,y1c,x1a,x1b,x1c,x2a,x2b,x2c,y2a,y2b,y2c; int x3a,x3b,x3c,y3a,y3b,y3c,x4a,x4b,x4c,y4a,y4b,y4c,x5a,x5b,x5c,y5a,y5b,y5c; int tx,shx,t,ch,a,ty; float ang,theta,sx,sy; int main(void) { int gdriver = DETECT, gmode, errorcode; initgraph(&gdriver, &gmode,"c:\\turboc3\\bgi"); printf("Enter all coordinates values :"); scanf("%d %d %d %d %d %d",&xa,&ya,&xb,&yb,&xc,&yc); setcolor(GREEN); line(xa,ya,xb,yb); /* draw the original image*/ line(xb,yb,xc,yc); line(xc,yc,xa,ya); printf("Enter the value tranlsation factor :"); /* get the translation factor*/ scanf("%d",&tx); printf("Enter ty:"); scanf("%d",&ty); x1a=xa+tx; x1b=xb+tx; x1c=xc+tx; y1a=ya+ty; y1b=yb+ty; y1c=yc+ty; setcolor(RED); line(x1a,y1a,x1b,...

PL/SQL program to print a string and number |PL/SQL|

PL/SQL PL/SQL is a block structured language that can have multiple blocks in it Pl/SQL stands for "Procedural Language extension of SQL" that is used in Oracle. PL/SQL includes procedural language elements like conditions and loops. It allows declaration of constants and variables, procedures and functions, types and variables of those types and triggers. code: DECLARE name varchar(50):='Hello world'; reg_no varchar(20):='24'; BEGIN dbms_output.put_line('Name: '||name); dbms_output.put_line('Registered number: '||reg_no); END; / Code Explanation: dbms_output.put_line(): It is used for printing the output to the console screen. The DBMS_OUTPUT is a built-in package that enables you to display output, debugging information. The put_line is the most useful function to enable the package for the write data in the program.  Here the first line turns on serveroutput .  the SERVEROUTPUT setting controls whether SQL*Plus prints the output generate...

C PROGRAM TO FIND LEAP YEAR |LEAP YEAR|

Image
 C program to find leap year or not Code: #include<stdio.h> int main() { int year; printf("enter the year:"); scanf("%d",&year); if((year % 400==0)&&(!year % 100==0)||(year % 4==0)) {       printf("year %d is a leap year",year); } return 0; } Explanation: The user enter the year. The user entered year is stored in variable called "year" which is a integer datatype. We had used if statement to check whether the entered year is leap year or not. In if condition year%400=0 and ! year%100==0 or year%4=0 will be true only if both conditions are stratified. If the condition is true then it will print the year is leap year . If the condition is false then the printf statement won't be printed. It will come out of the condition. Output: