Data Flow Diagram

Data Flow Diagram
Project:- Hospital Management system

Tuesday, October 18, 2011

copy file content to another file


/*
    this code transfer the data from one file to another file
    both  file name is given at the run time
   
*/
import java.io.*;

class CopyFile
{
       public static void main(String args[]) throws IOException
       {
             int i;
             FileInputStream fin;
             FileOutputStream fout;
             try
               {
                          // open input file
                      try {
                                    fin = new FileInputStream(args[0]);
                            }
                      catch(FileNotFoundException e){
                                System.out.println("Input File Not Found");
                               return;
                            }
                           // open output file\
                         try {
                                         fout = new FileOutputStream(args[1]);
                              }
                       catch(FileNotFoundException e) {
                             System.out.println("Error Opening Output File");
                             return;\
                         }
                    } catch(ArrayIndexOutOfBoundsException e) {
                                System.out.println("Usage: CopyFile From To");
                                 return;
                   }
                  // Copy File
                 try {
                             do{
                                       i = fin.read();
                                       if(i != -1)
                                                fout.write(i);
                                  } while(i != -1);
                          }catch(IOException e) {
                                    System.out.println("File Error");
                                    }
                         fin.close();
                          fout.close();
                }

}

static keyword in java


/*

static:doesn’t require the object of class to

access the member of that class and access the member of

that class with the name of class directly

*/

///example for static member function and data of class

class Mclass
{
         private static int a;
         static int b;
          public Mclass(int x)   {
                  a=x;
           }
         public static void funStatic() {
                   System.out.println("this is static method");
                   System.out.println("static variable : "+a++);
                   System.out.println("static variable : "+b);
            }
           }
class Sclass
{
    static void funmain()
    {
            System.out.println("this is static method in main");
    }
   public static void main(String args[])
     {
           Mclass m1=new Mclass(10);
           funmain(); //doesn't require the object to access
          Mclass.b=20; //static variable is accessed
             Mclass.funStatic(); //call directly from class nam
         }

}

Tuesday, July 5, 2011

“params” keyword in C#


The params keyword lets you specify a method parameter that takes an argument where the number of arguments is variable.


No additional parameters are permitted after the params keyword in a method declaration, and only one params keyword is permitted in a method declaration.

using System;


public class MyClass {

public static void UseParams(params int[] list)
 {

       for (int i = 0 ; i < list.Length; i++) {

               Console.WriteLine(list[i]);
        }
 }

public static void UseParams2(params object[] list) {

for (int i = 0 ; i < list.Length; i++) {

        Console.WriteLine(list[i]);

  }
 }

static void Main() {

     UseParams(1, 2, 3);

     UseParams2(1, 'a', "test");

       int[] myarray = new int[3] {10,11,12};

       UseParams(myarray);

}

}

Monday, March 22, 2010

How to design DFD or Data Flow Diagram

"Above DFD Example Shown about the any Hospital Management"
  • Circle represent the Process or Module to be performed in Hospital.
  • Two paralell line represent the database where the information to be stored.
  • Line shown the connectivity between Process and User

"Now you make yourself any DFD with the help of this DFD"

waiting for your suggestion........