Tuesday, 26 April 2022

DRAW A INDIAN NATIONAL FLAG USING JAVA APPLET

                             DRAW A INDIAN NATIONAL FLAG USING JAVA APPLET

INDIAN NATIONAL FLAG




//JAVA FILE

import java.awt.*;
import java.applet.*;
public class flag extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.blue);
g.fillRect(50,20,5,300);
g.setColor(Color.black);
g.drawRect(50,18,3,300);
g.setColor(Color.orange);
g.fillRect(55,20,120,30);
g.setColor(Color.black);
g.drawRect(55,20,118,28);
g.setColor(Color.green);
g.fillRect(55,80,119,30);
g.setColor(Color.black);
g.drawRect(55,80,117,28);
g.setColor(Color.black);
g.drawOval(100,50,30,30);
}
}



//HTML FILE

<html>
<applet code=flag.class height=300 width=300></applet>
</html>



INDIAN NATIONAL FLAG





Wednesday, 20 April 2022

DRAW A CYCLE USING JAVA APPLET

                                         DRAW A CYCLE USING JAVA APPLET


//java file

import java.awt.*;

import java.applet.*;

public class cycle extends Applet

{

public void paint(Graphics g)

{

g.drawLine(100,100,230,100);

g.drawLine(90,90,165,180);

g.drawLine(240,90,165,180);

g.drawLine(100,100,65,180);

g.drawLine(230,100,265,180);

g.drawOval(30,145,70,70);

g.drawOval(230,145,70,70);

g.setColor(Color.red);

g.fillOval(55,170,20,20);

g.setColor(Color.green);

g.fillOval(145,160,40,40);

g.setColor(Color.black);

g.drawLine(65,170,165,160);

g.drawLine(65,190,165,200);

g.setColor(Color.blue);

g.fillOval(255,170,20,20);

g.setColor(Color.black);

g.drawLine(0,215,600,215);

}

}

//html file

<html>

<applet code=cycle.class height=600 width=600></applet>

</html>




Wednesday, 2 February 2022

MINI PROJECTS OF C-PROGRAMMING ||| "TIC TAC TOE" -- GAME

    MINI PROJECTS OF C-PROGRAMMING

   "TIC TAC TOE" -- GAME


//HEADER FILES

#include<stdio.h>

#include<conio.h>

//GLOBAL VARIABLE DECLARATION

char ch[9]={'1','2','3','4','5','6','7','8','9'};

char str1[100],str2[100];

//MAIN FUNCTION

main()

{

int i,y;

    game_name();

playboard();

players();

for(i=1;i<=9;i++)

{

symbol_input(i);

playboard();

y=checker();

if(y==1)

break;

}

}

//GAME_NAME FUNCTION

int game_name()

{

printf("\n         **** TIC TAC TOE ****");

return 0;

}

//PLAYBOARD FUNCTION

int playboard()

{

printf("\n\n\n\n           %c  |   %c  |   %c  ",ch[0],ch[1],ch[2]);

printf("\n        ______|______|______");

printf("\n           %c  |   %c  |   %c  ",ch[3],ch[4],ch[5]);

printf("\n        ______|______|______");

printf("\n           %c  |   %c  |   %c  ",ch[6],ch[7],ch[8]);

printf("\n              |      |     ");

return 0;

}

//PLAYERS FUNCTION

int players()

{

printf("\n\n\n ENTER THE NAME OF FIRST PLAYER:-");

gets(str1);

printf("\n ENTER THE NAME OF SECOND PLAYER:-");

gets(str2);

printf("\nSYMBOL OF PLAYER 1,%s:X",str1);

printf("\nSYMBOL OF PLAYER 2,%s:0",str2);

return 0;

}

//SYMBOL_INPUT FUNCTION

int symbol_input(int x)

{

int j,a;

char mark[1];

a=x% 2;

switch(a)

{

case 0:

{

printf("\n\n%s,ENTER THE ROOM NUMBER,WHERE YOU ENTER YOUR SYMBOL:-",str2);

gets(mark);

for(j=0;j<9;j++)

{

if(ch[j]==mark[0])

{

ch[j]='0';

}

}

break;

}

    case 1:

{

             printf("\n\n%s,ENTER THE ROOM NUMBER,WHERE YOU ENTER YOUR SYMBOL:-",str1);

gets(mark);

for(j=0;j<9;j++)

{

if(ch[j]==mark[0])

{

ch[j]='X';

}

}

break;

}

}

return 0;

}

//CHECKER FUNCTION

int checker(int s)

{

if(ch[0]==ch[3] && ch[3]==ch[6])

{

if(ch[3]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[1]==ch[4] && ch[4]==ch[7])

{

if(ch[4]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[2]==ch[5] && ch[5]==ch[8])

{

if(ch[5]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[0]==ch[1] && ch[1]==ch[2])

{

if(ch[1]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[3]==ch[4] && ch[4]==ch[5])

{

if(ch[4]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[6]==ch[7] && ch[7]==ch[8])

{

if(ch[7]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[0]==ch[4] && ch[4]==ch[8])

{

if(ch[4]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

else if(ch[2]==ch[4] && ch[4]==ch[6])

{

if(ch[4]=='x')

{

printf("\nWINNER PLAYER:-%s",str1);

    }

    else{

    printf("\nWINNER PLAYER:-%s",str2);

}

return 1;

}

return 0;

}


Tuesday, 1 February 2022

MINI PROJECT OF C-PROGRAMMING |||| CAR PARKING MANAGEMENT

        MINI  PROJECT  OF  C-PROGRAMMING

                CAR  PARKING  MANAGEMENT


//header files\
#include<stdio.h>
#include<conio.h>
//global variable declaration
//no2=number of two whellers
//n03=number of three whellers
//no4= number of four whellers
//amount=total income of today
int no2=0,no3=0,no4=0,amount=0;
//mainfunction
main()
{
int i;
for(i=1;i<10000;i++)
{
  menu();
}

}
//menu function
int menu()
{
int ch;
  printf("\n******MENU******\n1.press '1' for entry.\n2.press '2' for exist.\n3.press '3' for status");
  printf("\nenter your choice:-");
  scanf("%d",& ch);
   switch(ch)
 {
  case 1:
  {
  entry();
break;
}
case 2:
{
exist();
break;
    }
case 3:
{
display();
break;
    }  
 }
  return 0;
}
//entry function
int entry()
{
int choice_entry;
  printf("\n*****MENU*****\n1.press '1' for two whellers.\n2.press '2' for three whellers.\n3.press '3' for four whellers.\n enter your choice:-");
  scanf("%d",& choice_entry);
  switch(choice_entry)
  {
  case 1: 
  {
  two_whellers_entry();
  break;
  }
case 2:
  {
three_whellers_entry();
break;
  } 
case 3:
   {
four_whellers_entry();
break;
   }   
  }
  return 0;
}
//exist function
int exist()
{
int choice_exist;
  printf("\n*****MENU*****\n1.press '1' for two whellers.\n2.press '2' for three whellers.\n3.press '3' for four whellers.\n enter your choice:-");
  scanf("%d",& choice_exist);
  switch(choice_exist)
  {
  case 1: 
  {
  two_whellers_exist();
  break;
  }
case 2:
  {
three_whellers_exist();
break;
  } 
case 3:
   {
four_whellers_exist();
break;
   }   
  }
  return 0;
}
//display function
int display()
{
printf("\nTotal number of two_whellers in the garage:-%d",no2);
printf("\nTotal number of three_whellers in the garage:-%d",no3);
printf("\nTotal number of four_whellers in the garage:-%d",no4);
printf("\n Total income of today:-%d",amount);
return 0;
}
//two whellers entry
int two_whellers_entry()
{
  int a;
  printf("\nenter the number of two_whellers($10):-");
  scanf("%d",& a);
  no2=no2+a;
  amount=amount+(a*10);
}
//three whellers entry
int three_whellers_entry()
{
  int b;
  printf("\nenter the number of three_whellers($20):-");
  scanf("%d",& b);
  no3=no3+b;
  amount=amount+(b*20);
}
//four whellers entry
int four_whellers_entry()
{
 
  int c;
  printf("\nenter the number of four_whellers($30):-");
  scanf("%d",& c);
  no4=no4+c;
  amount=amount+(c*30);
}
//two whellers exist
int two_whellers_exist()
{
     int a;
  printf("\nenter the number of three_whellers:-");
  scanf("%d",& a);
  no2=no2-a;
}
//three whellers exist
int three_whellers_exist()
{
     int b;
  printf("\nenter the number of three_whellers:-");
  scanf("%d",& b);
  no3=no3-b;
}
//four whellers exist
int four_whellers_exist()
{
     int c;
  printf("\nenter the number of three_whellers:-");
  scanf("%d",& c);
  no4=no4-c;
}




DRAW A INDIAN NATIONAL FLAG USING JAVA APPLET

                              DRAW A INDIAN NATIONAL FLAG USING JAVA APPLET INDIAN NATIONAL FLAG //JAVA FILE import java.awt.*; import java....