DRAW A INDIAN NATIONAL FLAG USING JAVA APPLET
Sgcoder126
Tuesday, 26 April 2022
DRAW A INDIAN NATIONAL FLAG USING JAVA APPLET
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
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....
