• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

ProjectsGeek

First Program in Java

April 4, 2012 by ProjectsGeek Leave a Comment

First Program in Java
 public class FirstProgram  {  
      public static void main( String [] args )   
   {  
           System.out.print (“Java Program”);  
           System.out.print (“My Program”);  
   }  
  }  

C:\ javac FirstProgram.java
C:\java FirstProgram
Java Program My Program

 

 public class FirstProgram  {  
      public static void main( String [] args )   
   {  
           System.out.print (“Java Program”);  
           System.out.println (“My Program”);  
   }  
  }  

C:\ javac FirstProgram.java
C:\java FirstProgram
Java Program
My Program

 

Questions for Practice :
 What are the advantages of Java? 

What is the difference between an interpreter and a compiler?

Define Class and Object?

What are different Java programs.

Other Projects to Try:

  1. Java Programs
  2. To Implement a Program Retrieval of Documents using Inverted Files
  3. Threads in Java Tutorial for Beginners
  4. Email Program System Java Project
  5. Java Programming from program analysis to program Design By -DS Malik

Filed Under: Java Projects Tagged With: Java Projects

Public and Private Keywords

April 4, 2012 by ProjectsGeek Leave a Comment

Public and Private Keywords Java
The public keyword is an access specifier.
Determines how the other parts of the program can access the members of the class.
When a class member is preceded by public, then that member can be access by code outside the class in which it is declared. 

The opposite of public is private.
Prevents a member from being used by code defined outside of its class.

In our program, main() must be declared as public since it must be called by code outside of its class when the program is started.

The keyword static allows main() to be called before an object of the class has been created.
This is necessary since main() is called before an object of the class has been created.

The keyword void tells the compiler that main() does not return a value.
Methods may also return values.

As stated, main() is the method called when a Java application begins.

Any information that you need to pass to a method is received by variables specified within the set of parentheses that follow the name of the method.
These variables are called parameters.
If no parameters are required for a given method, you still need to include the empty parentheses.

The next line
System.out.println (“Java Language”);
Outputs the string “Java Language” followed by  a new line on the screen.

Output is accomplished by the built-in println( ) method.
println( ) displays the string which is passed to it. println( ) can be used to display other types of information as well.

The line begins with System.out.
System is a pre-defined class that provides access to the system out is the output stream that is connected to the console.

System.out is an object that encapsulates console output.
Console input and output is not used frequently in real-world Java programs and applets. Since most application are windowed and graphical in nature, console I/O is used for simple utility programs and demonstration programs.

All statements in Java end with a semicolon.
Notice that the println( ) statement ends with a semicolon.

Java is case sensitive.
If you accidentally type Main instead of main, the program will be incorrect.
Although the Java compiler will compile classes that do not contain a main() method, it has no way to execute them.

 

Public and Private Keywords 1

Other Projects to Try:

  1. Java Programs
  2. First Program in Java
  3. Threads in Java Tutorial for Beginners
  4. Socket programming in Java
  5. Declaring Classes in TypeScript Angular 2

Filed Under: Java Projects Tagged With: Java Projects

Java Programs

April 3, 2012 by ProjectsGeek Leave a Comment

                   Java Programs
Applets
Small programs designed to add interactivity to Web sites
Downloaded with the Web page and launched by the Internet browser

Servlets

Run by Web server on the server
Typically generate Web content

Applications

Programs that run standalone on a client
Developing a Java Program 

Write the source code

  • Using an Integrated Development Environment (IDE) or text editor. Save in a .java file
Compile the source code:          javac ClassName.java
  • Creates .class file
Execute the application:         java ClassName
  • Run by the Java Virtual Machine

Sample Program

 // FirstProgram.java  
  public class FirstProgram  {  
   public static void main( String [] args )  
   {  
     System.out.println (“Java Program”);  
   }  
  }  

C:\ javac FirstProgram.java
C:\java FirstProgram
Java Program

The first line of the program uses the keyword class to declare that a new class is being defined.
A class is Java’s basic unit of encapsulation.
FirstProgram is the name of the class.

The class definition begins with an opening curly brace { and ends with a closing curly brace }

All program activity occurs within a class.

The next line of the program begins the main() method.
This is the line at which the program will begin executing.
All Java applications begin execution by calling main(). Just like C and C++
Statements and expressions are similar to those in other languages, and in most cases, identical to those of C or C++.

 

Java Programs 2

Other Projects to Try:

  1. First Program in Java
  2. Public and Private Keywords
  3. Java Tutorial for beginners – Introduction to Java
  4. Introduction to Java
  5. Assembly Programs

Filed Under: Java Projects Tagged With: Java Projects

Introduction to Java

April 3, 2012 by ProjectsGeek Leave a Comment

Introduction to Java
Part 1 Contents :

  •     History of Java
  •     What is JDK
  •     Features of Java
  •     Sample program 


History of Java

Java is Object oriented, Multi-threading language developed by Sun Microsystems in 1991.

It is designed to be small, simple and portable across different platforms as well as OS.

What is JDK

JDK stands for Java development Kit.

There are two parts: Java Compiler and Java Interpreter (JVM).

Java Compiler generates bytecode instead of machine code and interpreter executes java

program. 

What is bytecode?

Bytecode is a set of instructions that resemble machine code but are not specific to any

processor.

The disadvantage of using bytecode is the execution speed. Since system specific programs

run directly on the hardware, they are faster than the Java bytecode. 

Features of Java

  1. Syntax based on C++
  2. Object-oriented
  3. Support for Internet applications
  4. Extensive library of prewritten classes
  5. Portability among platforms
  6. Built-in networking
  7. Security as JRE is inaccessible to other parts of computer. 

Class 

  • Tool for encapsulating data and operations (methods) into one package
  • Defines a template or model for creating and manipulating objects

Objects
  • Data created using the class and its methods
  • An object is an instance of the class
  • Creating an object is instantiation
OOP : Advantage
  • Well-written classes can be reused in new applications
  • Shortens development time because programmers don’t need to write new code
  • Programs are more robust because the class code is already tested
  
Introduction to Java 3

Other Projects to Try:

  1. Java for Programmers By -Paul Dietel and Harvey Dietel
  2. First Program in Java
  3. Active X DLL in VB.Net
  4. Java Applet Tutorial for Beginners
  5. Java Tutorial for beginners – Introduction to Java

Filed Under: Java Tutorials

Online File Compression Project

April 3, 2012 by ProjectsGeek 3 Comments

Online File Zipper Project using GZIP algorithm
The Domain “Sun Zip” lets you reduce the overall number of bits and bytes in a file so it can be transmitted faster over slower Internet connections, or take up less space on a disk. Domain Sun Zip is a System Based Software. The user need not depend on third party software’s like winzip, winrar, Stuff etc.
The Domain “File Compression” lets you reduce the overall number of bits and bytes in a
file so it can be transmitted faster over slower Internet connections, or take up less space
on a disk. Domain File compression is a System Based Software. The software will be
done using Core Java. It can use in the System as a utility. The type of compression we
will use here is called loss less compression. The user need not depend on third party
software’s like winzip, winrar, Stuff etc. the software can be used to compress files and
they can be decompressed when the need arises. For implementing this Software we
want to use algorithms
The main algorithms are
 GZIP algorithm
Here in this Domain we will use Gzip algorithm. Using core JAVA we can import GZIP
algorithmic classes directly e.g.: import java.util.Zip.GZipInputStream 

 

Download Project
Download Project

Other Projects to Try:

  1. Implement Conflation Algorithm using File Handling in Java
  2. File Compression project in Java
  3. To Perform File Handling in Java
  4. File Handling program using Java
  5. MCA Projects in Java

Filed Under: Final Year Projects Tagged With: Project Ideas

Cricket Database Project

March 18, 2012 by ProjectsGeek Leave a Comment

 Cricket Database in C++

 

 #include  
 #include  
 #include  
 #include  
 #include  
 #include  
 #include  
 #include  
 #include  
 /*------------------base class--------------------------------------*/  
 class player  
 {  
   float strate,btavg,blavg;  
   int runs,wic,hiscr,bbol,overs,balls,innings,r1,w1,o1,b1,hcen,cen,i1;  
   public:  
   int mat;  
   char name[10];  
   char country[10];  
   player();  
   void getdata();  
   void update();  
   void showdata();  
   void calculation();  
   void search();  
   void modify();  
   void updatetest();  
   void menu();  
 };  
 /*----------------------constructor-------------------------------------*/  
 player::player()  
 {  
   strcpy(name," ");  
   strcpy(country," ");  
   strate=0;  
   btavg=0;  
   innings=0;  
   balls=0;  
   overs=0;  
   blavg=0;  
   runs=0;  
   wic=0;  
   mat=0;  
   hiscr=0;  
   bbol=0;  
   cen=0;  
   hcen=0;  
 }  
 /* -----------------------------fun for calculation ----------------------------*/  
 void player::calculation()  
 {  
   strate=(float)(runs/balls)*100;  
   btavg=(float)runs/innings;  
   blavg=(float)overs/wic;  
 }  
 /*---------------------- scan data from user ----------------------------------*/  
 void player::getdata()  
 {  
   cleardevice();  
   settextstyle(1,0,1);  
   outtextxy(100,50," ENTER DATA ");  
   settextstyle(0,0,1);  
   //cout<<"\n\t\t ENTER INFORMATION: \n\n";  
   cout<<"\n\n\n\t\t Name: ";  
   gets(name);  
   cout<<"\n\t\t Country: ";  
   gets(country);  
   cout<<"\n\t\t Matches: ";  
   cin>>mat;  
   cout<<"\n\t\t Innings: ";  
   cin>>innings;  
   cout<<"\n\t\t Runs: ";  
   cin>>runs;  
   cout<<"\n\t\t Balls Played: ";  
   cin>>balls;  
   cout<<"\n\t\t Fifties: ";  
   cin>>hcen;  
   cout<<"\n\t\t Hundreds: ";  
   cin>>cen;  
   cout<<"\n\t\t Overs Bowled: ";  
   cin>>overs;  
   cout<<"\n\t\t Wickets: ";  
   cin>>wic;  
   cout<<"\n\t\t Best Batting Performance: ";  
   cin>>hiscr;  
   cout<<"\n\t\t Best Bowling Performance: ";  
   cin>>bbol;  
 }  
 /*------------------------------ fun used for modification -------------------------*/  
 void player::update()  
 {  
   //cout<<"\n\n\t\t ENTER DATA OF LAST MATCH\n";  
   cleardevice();  
   settextstyle(1,0,1);  
   outtextxy(100,50," ENTER DATA OF LAST MATCH");  
   settextstyle(0,0,1);  
   cout<<"\n\n\n\t\t Runs: ";  
   cin>>r1;  
   if(r1>100)  
     cen++;  
   if(r1>50&&r1<100)  
     hcen++;  
   runs+=r1;  
   cout<<"\n\t\t Wickets: ";  
   cin>>w1;  
   wic+=w1;  
   mat++;  
   cout<<"\n\t\t OUT/NOTOUT(y/n): ";  
   char ch=getche();  
   if(ch=='y')  
     innings++;  
   cout<<"\n\t\t Overs Bowled :";  
   cin>>o1;  
   overs+=o1;  
   cout<<"\n\t\t Balls Played";  
   cin>>b1;  
   balls+=b1;  
   if(hiscr<r1) <br="">     hiscr=r1;  
   if(bbol<w1) <br="">     bbol=w1;  
 }  
 /*------------------------------------- fun for displaying the data ---------------------*/  
 void player::showdata()  
 {  
   int x=50;  
   char str[20];  
   cleardevice();  
   rectangle(50,150,610,250);  
   line(50,200,610,200);  
   for(int i=0;i<6;i++)  
   {  
     x+=80;  
     line(x,150,x,250);  
   }  
   outtextxy( 60,170,"MATCHS");  
   outtextxy(140,170,"RUNS");  
   outtextxy(220,170,"WICKETS");  
   outtextxy(300,170,"AVG(BAT)");  
   outtextxy(380,170,"AVG(BOL)");  
   outtextxy(460,170,"100`s");  
   outtextxy(540,170,"50`s");  
   outtextxy( 50,280,"BEST PERFORMANCE IN A MATCH ::");  
   outtextxy( 50,300,"RUNS : ");  
   outtextxy( 50,320,"WICKETS :");  
   sprintf(str,"%d",mat);  
   outtextxy(60,220,str);  
   sprintf(str,"%d",runs);  
   outtextxy(140,220,str);  
   sprintf(str,"%d",wic);  
   outtextxy(220,220,str);  
   sprintf(str,"%f",btavg);  
   outtextxy(300,220,str);  
   sprintf(str,"%f",blavg);  
   outtextxy(380,220,str);  
   sprintf(str,"%d",cen);  
   outtextxy(460,220,str);  
   sprintf(str,"%d",hcen);  
   outtextxy(540,220,str);  
   settextstyle(1,0,1);  
   sprintf(str,"%s",country);  
   outtextxy(50,110,str);  
   sprintf(str,"%s",name);  
   outtextxy(50,90,str);  
   settextstyle(0,0,1);  
   sprintf(str,"%d",hiscr);  
   outtextxy(130,300,str);  
   sprintf(str,"%d",bbol);  
   outtextxy(130,320,str);  
   getch();  
 }  
 fstream file,file1,tfile,tfile1;  
 int ch1;  
 /*----------------------------- main ----------------------------------------*/  
 void main()  
 {  
   player p;  
   clrscr();  
   int ch,i=0,gm,gd=DETECT;  
   char st[10];  
   int x,y;  
   x=100;  
   y=100;  
   initgraph(&gd,&gm,"g:\\tc\\bgi");  
   char pname[10],cname[10],password[10]="",c;  
   setbkcolor(BLUE);  
   while(!kbhit())  
   {  
     settextstyle(1,0,6);  
     outtextxy(150,200,"CRICKETER`S");  
     outtextxy(170,270,"DATABASE");  
   }  
   settextstyle(0,0,1);  
   cleardevice();  
   setcolor(11);  
   settextstyle(1,0,1);  
   outtextxy(100,380,"LOADING...");  
   for(i=0;i<401;i++)  
   {  
     outtextxy(100+i,400,"#");  
     if(i<400&&i>370)  
     delay(40);  
    delay(10);  
   }  
   settextstyle(0,0,1);  
   cleardevice();  
   getch();  
   //cleardevice();  
   /*------------------ starting menu ------------------*/  
   int tag;  
   tag:  
   cleardevice();  
   settextstyle(1,0,2);  
   outtextxy(200,100," 1 :: ONE DAY") ;  
   outtextxy(200,130,"   2 :: TEST") ;  
   //cin>>ch1;  
   ch1=getche();  
   ch1=ch1-'0';  
   settextstyle(0,0,1);  
   if(ch1==1)  
   {  
     do  
     {  
       cleardevice();  
       //p.menu();  
       settextstyle(1,0,2);  
       outtextxy(200,100," 1 :: ADD RECORDS ") ;  
       outtextxy(200,130," 2 :: MODIFY RECORDS ") ;  
       outtextxy(200,160," 3 :: SEARCH RECORD (NAME)") ;  
       outtextxy(200,190," 4 :: SEARCH RECORD (COUNTRY)") ;  
       outtextxy(200,220," 5 :: LIST OF PLAYER OF ONE COUNTRY") ;  
       outtextxy(200,250," 6 :: BACK") ;  
       outtextxy(200,280," 7 :: EXIT") ;  
       //cin>>ch;  
       ch=getche();  
       ch=ch-'0';  
       settextstyle(0,0,1);  
       switch(ch)  
       {  
         /*----- ODI insert ----------------------*/  
         case 1:  
         cleardevice();  
         file.open("ODI.txt",ios::in|ios::out|ios::ate);  
         file.seekp(0,ios::end);  
         p.getdata();  
         p.calculation();  
         file.write((char*)&p,sizeof(p));  
         file.clear();  
         file.close();  
         c=getch();  
         break;  
         /*------- ODI name wise search --------------------*/  
         case 3:  
         cleardevice();  
         cout<<"\n\t\t Name For Search: ";  
         gets(pname);  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           //if(i>250&&i<300)  
            //  delay(40);  
           delay(10);  
         }  
         cleardevice();  
         int flag=0;  
         file.open("ODI.txt",ios::in|ios::out|ios::ate);  
         file.seekp(0,ios::beg);  
         while(file.read((char*)&p,sizeof(p)))  
         {  
           if(!strcmp(p.name,pname))  
           {  
             flag=1;  
             cout<<"\n\n";  
             p.showdata();  
             break;  
           }  
         }  
         file.clear();  
         file.close();  
         if(flag==0)  
         cout<<"\n\t\t Record Not Found";  
         //cout<<"\n\n\t\t Enter Any Key To Cont.";  
         //cin>>c;  
         c=getch();  
         break;  
         /*-------------- ODI modification -------------------------*/  
         case 2:  
         cleardevice();  
         cout<<"\n\t\tENTER PASSWORD ";  
         int i=0;  
         while(i<6)  
         {  
            password[i]=getche();  
         cout<<"*";  
         i++;  
         }  
         getch();  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
           if(i>350&&i<400)  
             delay(40);  
         }  
         cleardevice();  
         if(!strcmp("vineet",password))  
         {  
           cout<<"\n\t\t Name For Modification ";  
           gets(pname);  
           flag=0;  
           file.open("ODI.txt",ios::in|ios::out|ios::ate);  
           file1.open("temp1.txt",ios::in|ios::out|ios::ate);  
           if(!tfile1)  
             cout<<"\nerror";  
           file1.seekp(0,ios::beg);  
           file.seekp(0,ios::beg);  
           while(file.read((char*)&p,sizeof(p)))  
           {  
             if(!strcmp(p.name,pname))  
             {  
               flag=1;  
               p.update();  
               p.calculation();  
               file1.write((char*)&p,sizeof(p));  
             }  
             else  
             {  
               tfile1.write((char*)&p,sizeof(p));  
             }  
           }  
           file.clear();  
           file.close();  
           file1.clear();  
           file1.close();  
           if(flag==1)  
           {  
             remove("ODI.txt");  
             rename("temp1.txt","ODI.txt");  
           }  
           if(flag==0)  
             cout<<"\n\t\t Record Not Found";  
         }  
         else  
           cout<<"\n\t\t Wrong Password";  
         c=getch();  
         break;  
         /*------------ ODI country wise search --------------*/  
         case 4:  
         cleardevice();  
         cout<<"\n\t\t Country`s Name For Search: ";  
         gets(cname);  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
           //if(i>333&&i<400)  
            //  delay(40);  
         }  
         cleardevice();  
         flag=0;  
         file.open("ODI.txt",ios::in|ios::out|ios::ate);  
         file.seekp(0,ios::beg);  
         while(file.read((char*)&p,sizeof(p)))  
         {  
           if(!strcmp(p.country,cname))  
           {  
             flag=1;  
             cout<<"\n\n";  
             p.showdata();  
           }  
         }  
         file.clear();  
         file.close();  
         if(flag==0)  
           cout<<"\n\t\t Record Not Found";  
         //cout<<"\n\n\t\t Enter Any Key To Cont.";  
         //cin>>c;  
         c=getch();  
         break;  
         /*------ ODI list of players ---------------------*/  
         case 5:  
         cleardevice();  
         cout<<"\n\t\t Country`s Name For Search: ";  
         gets(cname);  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
         }  
         cleardevice();  
         flag=0;  
         file.open("ODI.txt",ios::in|ios::out|ios::ate);  
         file.seekp(0,ios::beg);  
         while(file.read((char*)&p,sizeof(p)))  
         {  
           if(!strcmp(p.country,cname))  
           {  
             flag=1;  
             settextstyle(1,0,1);  
             //cout<<"\n\n\t\t"<<p.name; <br="">

             sprintf(st,"%s",p.name);  
             outtextxy(x,y,st);  
             y=y+30;  
             settextstyle(0,0,1);  
           }  
         }  
         file.clear();  
         file.close();  
         if(flag==0)  
         cout<<"\n\t\t Record Not Found";  
         //cout<<"\n\n\t\t Enter Any Key To Cont.";  
         //cin>>c;  
         c=getch();  
         break;  
         case 6:  
         goto tag;  
         //break;  
         case 7:  
         exit(0);  
         break;  
       }  
     }while(1);  
   }  
   if(ch1==2)  
   {  
     do  
     {  
       cleardevice();  
       //p.menu();  
       settextstyle(1,0,2);  
       outtextxy(200,100," 1 :: ADD RECORDS ") ;  
       outtextxy(200,130," 2 :: MODIFY RECORDS ") ;  
       outtextxy(200,160," 3 :: SEARCH RECORD (NAME)") ;  
       outtextxy(200,190," 4 :: SEARCH RECORD (COUNTRY)") ;  
       outtextxy(200,220," 5 :: LIST OF PLAYER OF ONE COUNTRY") ;  
       outtextxy(200,250," 6 :: BACK") ;  
       outtextxy(200,280," 7 :: EXIT") ;  
       //cin>>ch;  
       ch=getche();  
       ch=ch-'0';  
       settextstyle(0,0,1);  
       switch(ch)  
       {  
         /*------------------ TEST insert ------------------*/  
         case 1:  
         cleardevice();  
         tfile.open("TEST.txt",ios::in|ios::out|ios::ate);  
         tfile.seekp(0,ios::end);  
         p.getdata();  
         p.calculation();  
         tfile.write((char*)&p,sizeof(p));  
         tfile.clear();  
         tfile.close();  
         break;  
         /*------------------ TEST name wise search ------------------*/  
         case 3:  
         cleardevice();  
         cout<<"\n\t\t Name For Search: ";  
         gets(pname);  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
           if(i>350&&i<400)  
             delay(40);  
         }  
         cleardevice();  
         int flag=0;  
         tfile.open("TEST.txt",ios::in|ios::out|ios::ate);  
         tfile.seekp(0,ios::beg);  
         while(tfile.read((char*)&p,sizeof(p)))  
         {  
           if(!strcmp(p.name,pname))  
           {  
             flag=1;  
             cout<<"\n\n";  
             p.showdata();  
             break;  
           }  
         }  
         tfile.clear();  
         tfile.close();  
         if(flag==0)  
         cout<<"\n\t\t Record Not Found";  
         c=getch();  
         break;  
         /*------------------ TEST modification ------------------*/  
         case 2:  
         cleardevice();  
         cout<<"\n\t\tENTER PASSWORD";  
         int i=0;  
         while(i<6)  
         {  
            password[i]=getche();  
         cout<<"*";  
         i++;  
         }  
         getch();  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
           if(i>350&&i<400)  
             delay(40);  
         }  
         cleardevice();  
         if(!strcmp("vineet",password))  
         {  
           cout<<"\n\t\t Name For Modification ";  
           gets(pname);  
           flag=0;  
           tfile.open("TEST.txt",ios::in|ios::out|ios::ate);  
           tfile1.open("temp1.txt",ios::in|ios::out|ios::ate);  
           if(!tfile1)  
             cout<<"\nerror";  
           tfile1.seekp(0,ios::beg);  
           tfile.seekp(0,ios::beg);  
           while(tfile.read((char*)&p,sizeof(p)))  
           {  
             if(!strcmp(p.name,pname))  
             {  
               flag=1;  
               cout<<"\n\t\t Enter Data For First Inning: ";  
               p.update();  
               cout<<"\n\t\t Enter Data For Second Inning: ";  
               p.update();  
               p.mat--;  
               p.calculation();  
               tfile1.write((char*)&p,sizeof(p));  
             }  
             else  
             {  
               tfile1.write((char*)&p,sizeof(p));  
             }  
           }  
           tfile.clear();  
           tfile.close();  
           tfile1.clear();  
           tfile1.close();  
           if(flag==1)  
           {  
             remove("TEST.txt");  
             rename("temp1.txt","TEST.txt");  
           }  
           if(flag==0)  
             cout<<"\n\t\t Record Not Found";  
         }  
         else  
           cout<<"\n\t\t Wrong Password";  
         c=getch();  
         break;  
         /*------------------ TEST country wise search ------------------*/  
         case 4:  
         cleardevice();  
         cout<<"\n\t\t Country`s Name For Search: ";  
         gets(cname);  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
           if(i>350&&i<400)  
             delay(40);  
         }  
         cleardevice();  
         flag=0;  
         tfile.open("TEST.txt",ios::in|ios::out|ios::ate);  
         tfile.seekp(0,ios::beg);  
         while(tfile.read((char*)&p,sizeof(p)))  
         {  
           if(!strcmp(p.country,cname))  
           {  
             flag=1;  
             cout<<"\n\n";  
             p.showdata();  
           }  
         }  
         tfile.clear();  
         tfile.close();  
         if(flag==0)  
         cout<<"\n\t\t Record Not Found";  
         break;  
         /*------------------ TEST list ------------------*/  
         case 5:  
         cleardevice();  
         cout<<"\n\t\t Country`s Name For Search: ";  
         gets(cname);  
         cleardevice();  
         setcolor(10);  
         outtextxy(100,380,"LOADING...");  
         for(i=0;i<401;i++)  
         {  
           outtextxy(100+i,400,"#");  
           delay(10);  
           if(i>350&&i<400)  
             delay(40);  
         }  
         cleardevice();  
         flag=0;  
         tfile.open("TEST.txt",ios::in|ios::out|ios::ate);  
         tfile.seekp(0,ios::beg);  
         while(tfile.read((char*)&p,sizeof(p)))  
         {  
           if(!strcmp(p.country,cname))  
           {  
             flag=1;  
             settextstyle(1,0,1);  
             //cout<<"\n\n\t\t"<<p.name; <br="">

             sprintf(st,"%s",p.name);  
             outtextxy(x,y,st);  
             y=y+30;  
             settextstyle(0,0,1);  
             //cout<<"\n\n\t\t"<<p.name; <br="">

           }  
         }  
         file.clear();  
         file.close();  
         if(flag==0)  
         cout<<"\n\t\t Record Not Found";  
         //char c;  
         //cout<<"\n\n\t\t Enter Any Key To Cont.";  
         //cin>>c;  
         c=getch();  
         break;  
         case 6:  
         goto tag;  
         case 7:  
         exit(0);  
         break;  
       }  
     }while(1);  
   }  
 }  
 /* ------------------------------end of main -------------------------------*/

 
 

Other Projects to Try:

  1. string operations such as Copy, Length, Reversing, Palindrome, Concatenation
  2. Expression Tree using C Language
  3. Graphics Editor code Using C++ Language
  4. Cricket Database project using C++
  5. Cricket Game Java Project

Filed Under: C Assignments

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 104
  • Page 105
  • Page 106
  • Page 107
  • Page 108
  • Interim pages omitted …
  • Page 135
  • Go to Next Page »

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy