Posts

Showing posts from March 20, 2011

USE CASE DIAGRAM FOR RESERVATION

Image

DFD FOR STUDENT REGISTRATION SYSTEM

Image
FOR DFD FOUR BASIC NOTATIONS ARE: 1.LABELLED ARROW.----> 2.SOURCES OR SINK OF INFORMATION(EXTERNAL ENTITY): REPRESENTED BY SQUARE. 3.PROCESS ARE REPRESENTED BY CIRCLE AND ROUND SHAPE AS SHOWN ENROLL STUDENT I N THE GIVEN DFD. 4.DATA STORE REPRESENTED BY TWO PARALLEL LINES OR BY SHAPE FOR STUDENT MASTER FILE IN THE GIVEN DFD..

SIMPLE USE CASE DIAGRAM FOR REGISTRATION SYSTEM

Image

DFD FOR STUDENT REGISTRATION SYSTEM

Image

FLOWCHART FOR FINDING GREATEST OF THREE NUMBERS

Image

SMILEY MAKING THROUGH COMPUTER GRAPHICS

/* HEY AT LEAST APPRECIATE MY WORK DUDE */ #include<stdio.h> #include<conio.h> #include<graphics.h> void main() {  int gd=DETECT,gm;  initgraph(&gd,&gm,"c\\tc\bin");  setcolor(1);  circle(320,240,100);  setcolor(6);  circle(280,215,20);  setcolor(3);  circle(280,215,5);  setcolor(1);  circle(360,215,20);  setcolor(3);  circle(360,215,5);  setcolor(1);  line(300,270,340,270);  line(300,270,320,240);  line(340,270,320,240);  getch();  closegraph();  }

RAINBOW THROUGH COMPUTER GRAPHICS

#include<stdio.h> #include<conio.h> #include<graphics.h>  #include<dos.h> void main() {  int gd=DETECT,gm,x,y,i;  initgraph(&gd,&gm,"c\\tc\bin");  x=getmaxx()/2;  y=getmaxy()/2;  for(i=30;i<200;i++)  {  delay(100);  setcolor(i/10);  arc(x,y,0,180,i-10);  }  getch();  closegraph() ;  }

SIMPLE CIRCLE WITHOUT USING ALGO.

#include<stdio.h> #include<conio.h> #include<graphics.h> void main() {  int gm,gd; gd=DETECT; initgraph(&gd,&gm,""); int x,y,r; printf("enter the positions of x and y"); scanf("%d%d",&x,&y); printf("enter the radius"); scanf("%d",&r); circle(x,y,r); getch(); }

TO MAKE A CURVE SOURCE CODE

#include<stdio.h> #include<conio.h> #include<dos.h> #include<math.h> #include<graphics.h> void main() { int gd=DETECT,gm,erroecode; float i; float x=250,y=200; float a=10,b=15,r=0; initgraph(&gd,&gm,"c:\\tc\bgi"); while(!kbhit()) { for(i=0;i<100;i=i+0.01) { setcolor(7); r=(a*i)*sin(3*i) ; x=200+r*cos(i); y=200+r*sin(i); circle(x,y,0); delay(100); setcolor(4); } } getch(); }

PENDULUM

#include <GRAPHICS.H> #include <stdio.h> #include<math.h> #include<conio.h> #include<dos.h> void main() { clrscr(); int gd=DETECT,gm; float xc=20,yc=40,x,y,l,r,a,i,rad; initgraph(&gd,&gm,"f:\\TC\\bin\\BGI"); printf("\nEnter the length\n"); scanf("%f",&l); printf("\nEnter radius\n"); scanf("%f",&r); printf("\nEnter angle\n"); scanf("%f",&a); a=a/2; while(!kbhit) { for(i=-a;i<=a;i++) { rad=(3.14*i)/180; x=xc+(l*sin(rad)); y=yc+(l*cos(rad)); line(xc,yc,x,y); circle(x,y,r); setfillstyle(SOLID_FILL,10); floodfill(x,y,10); delay(10); cleardevice(); } for(i=a;i>=-a;i--) { rad=(3.14*i)/180; x=xc+(l*sin(rad)); y=yc+(l*cos(rad)); line(xc,yc,x,y); circle(x,y,r); setfillstyle(SOLID_FILL,10); floodfill(x,y,10); delay(10);       cleardevice(); } } getch(); }

MIDPOINT CIRCLE GENERATION METHOD

/* MIDPOINT CIRCLE DRAWING* / #include<stdio.h> #include<graphics.h> #include<math.h> #include<dos.h> #include<conio.h> void main() { char pattern[8] = {0x00, 0x70, 0x20, 0x27, 0x25, 0x27, 0x04, 0x04}; float p; int i,gd,gm,x,y; int r; detectgraph(&gd,&gm); initgraph(&gd,&gm,"f:\\tc\\bin\\bgi"); printf("enter  the radius of the circle"); scanf("%d",&r); x=0; y=r; p=(3)-r; //setbkcolor(7) ;     line(0, 0, 30, 10); setcbrk(5); do { for(i=0;i<5;i++) { putpixel(200+x,200+y,10); putpixel(200+y,200+x,5); putpixel(200+x,200-y,8); putpixel(200+y,200-x,5); putpixel(200-x,200-y,9); putpixel(200-x,200+y,5); putpixel(200-y,200+x,1); putpixel(200-y,200-x,5);  setfillpattern(pattern,getmaxcolor()); if(p<0) { x=x+1; y=y; p=p+2*x+2; } else { x=x+1; y=y-1; p=p+2*(x-y)+1 ; } delay(100); } } while(x<y); getch(); closegraph(); }

BRESENHAM LINE DRAWING

 /* BRESENHAM LINE DRAWING */ #include<stdlib.h> #include<graphics.h> #include<stdio.h> #include<conio.h> #include<alloc.h> #include<math.h> #include<dos.h> void   main() {clrscr(); float i,e,x,y,x1,y1,x2,y2,dx,dy,length; printf("enter the value of x1:\t"); scanf("%f",&x1);  printf("enter the value of y1:\t"); scanf("%f",&y1); printf("enter the value of x2:\t"); scanf("%f",&x2); printf("enter the value of y2:\t"); scanf("%f",&y2); int gdrives=DETECT,gmode; initgraph(&gdrives,&gmode,"f:\\tc\\bin\\bgi"); dx=abs(x2-x1); dy=abs(y2-y1); x=x1; y=y1; e=2*dy-dx; i=1; do { putpixel(x,y,15); while(e>=0) { y=y+1; e=e-2*dx; } delay(100); x=x+1; e=e+2*dy; i=i+1; } while(i<=dx); getch(); closegraph(); }