Easy to Code
Easy to Code
  • Home
  • Programs
    • Python
    • C Programs
      • BCA C Program
      • C Structure
    • Java Programs
    • Data Structure
    • C++ Programs
  • Sitemap
  • Privacy Policy
  • About Us
  • Contact Us

import java.awt.*;

import java.awt.event.*;

class MyFrame extends Frame implements ActionListener

{

Label l1;

Button b1;

int i;

MyFrame()

{

super("Exapmle of ActionListener");

l1=new Label("                           ");

b1=new Button("Click me");

b1.addActionListener(this);

i=0;

add(b1);

add(l1);

addWindowListener(new WindowAdapter() {

            public void windowClosing(WindowEvent we) {

                System.exit(0);

            }

        });

setLayout(new FlowLayout());

setSize(500,500);

setVisible(true);

}

public void actionPerformed(ActionEvent e)

{

i++;

l1.setText("Button Clicked: "+ Integer.toString(i));

}

}

public class MyActionListener

{

public static void main(String args[])

{

new MyFrame();

}

}

import java.awt.*;
import java.awt.event.*;
class MyFrame extends Frame implements ActionListener
{
	Label l1;
	Button b1;
	int i;
	MyFrame()
	{
		super("Exapmle of ActionListener");
		l1=new Label("                           ");
		b1=new Button("Click me");
		b1.addActionListener(this);
		i=0;
		
		add(b1);
		add(l1);
		
		addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent we) {
                System.exit(0);
            }
        });
		
		setLayout(new FlowLayout());
		setSize(500,500);
		setVisible(true);
	}
	public void actionPerformed(ActionEvent e)
	{
		i++;
		l1.setText("Button Clicked: "+ Integer.toString(i));
	}
}
public class MyActionListener
{
	public static void main(String args[])
	{
		new MyFrame();
	}
}
import java.util.*;
class Fibonacci
{
int n;
Fibonacci()
{
Scanner s=new Scanner(System.in);
System.out.print("Enter the number of terms: ");
n=s.nextInt();
}
void show()
{
int f=0,s=1,t;
System.out.print(f+","+s);
for(int i=3;i<=n;i++)
{
t=f+s;
System.out.print(","+t);
f=s;
s=t;
}
}
}
class TestFibo
{
public static void main(String args[])
{
Fibonacci f= new Fibonacci();
f.show();
}
} 
 import java.util.*;
import java.io.*;
class MyFile
{
File f1;
MyFile()
{
Scanner s = new Scanner(System.in);
System.out.print("Enter the path of file: ");
String path= s.nextLine();
System.out.print("Enter the name of file: ");
String name= s.nextLine();
f1=new File(path, name);
}
void check()
{
try
{
if(f1.isFile() && f1.exists())
{
FileInputStream fobj = new FileInputStream(f1);
int i=fobj.read();
while(i!=-1)
{
if(Character.isDigit((char)i))
{
System.out.println("Character is digit");
}
else if (Character.isSpace((char)i))
{
System.out.println("Character is Space");
}
else
{
if(Character.isUpperCase((char)i))
System.out.println(Character.toLowerCase((char)i));
else
System.out.println(Character.toUpperCase((char)i));
}
i=fobj.read();
}
}
else
{
System.out.println("File doesn't exist");
}
}
catch(Exception e)
{
System.out.print(e);
}
}
}
class slip1
{
public static void main(String args[])
{
MyFile obj = new MyFile();
obj.check();
}
}
import java.util.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class MySwing extends JFrame
{
Random rand;
Color randomColor;
MySwing()
{
super("Change Color");
setLayout(new FlowLayout());

setSize(500,500);
setVisible(true);
addWindowListener(new MyClose());
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
}
class MyClose extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
rand = new Random();
float r = rand.nextFloat();
float g = rand.nextFloat();
float b = rand.nextFloat();
randomColor = new Color(r, g, b);
repaint();
}
}

public void paint(Graphics g)
{
getContentPane().setBackground(randomColor);
}
}

class Slip14
{
public static void main(String[] args) {
MySwing obj= new MySwing();
}
}
 import java.applet.*;
import java.awt.event.*;
import java.awt.*;
//<applet code="Slip6" height=300 width=200></applet>
public class Slip6 extends Applet implements ActionListener
{
TextField t;
Button b[];
Panel p;
String c, arr[]={"1","2","3","+","4","5","6","-","7","8","9","*","0",".","=","/"};
double n1,n2,ans;
public void init()
{
t= new TextField(20);
b=new Button[16];
p= new Panel();
for(int i=0;i<16;i++)
b[i]=new Button(arr[i]);
p.setLayout(new GridLayout(4, 4, 10, 10));
p.setSize(700,1500);

}
public void start()
{
add(t);
for(int i=0;i<16;i++)
{
p.add(b[i]);
b[i].addActionListener(this);
}
add(p);
}
public void actionPerformed(ActionEvent ae)
{
switch (ae.getActionCommand())
{
case "1": insert("1"); break;
case "2": insert("2"); break;
case "3": insert("3"); break;
case "4": insert("4"); break;
case "5": insert("5"); break;
case "6": insert("6"); break;
case "7": insert("7"); break;
case "8": insert("8"); break;
case "9": insert("9"); break;
case "0": insert("0"); break;
case ".": insert("."); break;
case "+": addition(); break;
case "-": substract(); break;
case "*": multiply(); break;
case "/": divide(); break;
case "=": cal(); break;
}
}
void insert(String n)
{
if (t.getText().equals(""))
t.setText(n);
else
t.setText(t.getText()+n);
}
void addition()
{
n1=Double.parseDouble(t.getText());
t.setText(t.getText()+"+");
c="+";
}
void substract()
{
n1=Double.parseDouble(t.getText());
t.setText(t.getText()+"-");
c="-";
}
void multiply()
{
n1=Double.parseDouble(t.getText());
t.setText(t.getText()+"*");
c="*";
}
void divide()
{
n1=Double.parseDouble(t.getText());
t.setText(t.getText()+"/");
c="/";
}
void cal()
{
n2=Double.parseDouble(t.getText().substring(t.getText().indexOf(c)+1,t.getText().length()));
if(c.equals("+"))
{
t.setText(Double.toString(n1+n2));
n1=n1+n2;
}
if(c.equals("-"))
{
t.setText(Double.toString(n1-n2));
n1=n1-n2;
}
if(c.equals("*"))
{
t.setText(Double.toString(n1*n2));
n1=n1*n2;
}
if(c.equals("/"))
{
t.setText(Double.toString(n1/n2));
n1=n1/n2;
}
}
}
 /*
Write a java program to reverse the content of file using RandomAccessFile.
*/
import java.io.*;
import java.util.*;
class FileReverse
{
File f,f2;
String str;
FileReverse()
{
Scanner s=new Scanner(System.in);
System.out.println("Enter the source path: ");
String path=s.nextLine();
System.out.println("Enter the source name: ");
String name=s.nextLine();
f=new File(path,name);
}
void reverse()
{
try
{
RandomAccessFile file = new RandomAccessFile(f,"r");
long n= f.length()-1;
int i=0;
while (n>=0)
{
if (n==-1)
break;
else
{
file.seek(n);
i= file.read();
n=n-1;
System.out.print((char)i);
}
}
file.close();
}catch(Exception e)
{
System.out.print(e);
}
}
}
class TestFileReverse
{
public static void main(String args[])
{
FileReverse obj=new FileReverse();
obj.reverse();
}
}

 Preview- Click on image

Code-

Note - Save This File as index.html

<html>

<frameset rows="30%,*">

<frame src="heading.html">

<frame name="f3">

</frameset>

</html>

Note - Save This File as heading.html

<html>

<body>

<form>

<table  cellpadding=20 align=center>

<tr>

<td><img height=70px width=70px src="https://i.pinimg.com/originals/5f/9b/e5/5f9be5876eda5d373d7f91a8faf5e659.jpg"></td>

<td><font size=7>AirIndia</font></td>

<td><select>

<option value="India">India</option>

<option value="America">America</option>

<option value="Russia">Russia</option>

<option value="Malaysia">Malaysia</option>

</select>

</td>

</tr>

</table>

<table border=2 cellpadding=10 cellspacing=10  align=center>

<tr>

<td><font size=5><a href="home.html" target="f3">Home</a></font></td>

<td><font size=5><a href="trip.html" target="f3">Manage Your Trip</a></font></td>

</tr>

</table>

</form>

</body>

</html>

Note - Save This File as home.html

<html>

<body>

<table border=2 align=center>

<tr><td>

<table cellspacing=10>

<tr><td colspan=3><h1>Booking Information</h1></td></tr>

<tr><td>From:</td><td colspan=2><input type="text">

<tr><td>To:</td><td colspan=2><input type="text">

<tr><td>Departure Date:</td><td colspan=2><input type="text">

<tr><td>Returning Date:</td><td colspan=2><input type="text">

<tr><td>Adults</td><td>Children</td>

<td rowspan=2>

<select>

<option value="Economy">Economy</option>

<option value="Executive">Executive</option>

<option value="First">First</option>

</select>

</td>

</tr>

<tr><td>

<select>

<option value="one">1</option>

<option value="two">2</option>

<option value="three">3</option>

<option value="four">4</option>

<option value="five">5</option>

<option value="six">6</option>

<option value="seven">7</option>

<option value="eight">8</option>

<option value="nine">9</option>

</select>

</td>

<td>

<select>

<option value="zero">0</option>

<option value="one">1</option>

<option value="two">2</option>

<option value="three">3</option>

<option value="four">4</option>

<option value="five">5</option>

<option value="six">6</option>

<option value="seven">7</option>

<option value="eight">8</option>

<option value="nine">9</option>

</select>

</td>

</tr>

<tr><td colspan=3 align=center><input type="button" value="Book Now"></td></tr>

</table>

</td></tr>

</table>

</body>

</html>

Note - Save This File as trip.html

<html>

<form>

<h1 align=center>Manage Your Trip</h1>

<p align=center><u>Fare Details for Air India</u></p>

<table align=center border=2 cellpadding=10>

<tr>

<th>Class</th>

<th>Fare</th>

</tr>

<tr>

<td>Economy</td>

<td>10,000/-</td>

</tr>

<tr>

<td>Executive</td>

<td>20,000/-</td>

</tr>

<tr>

<td>First</td>

<td>30,000/-</td>

</tr>

</table>

<h3 align=right><a href="home.html">Home</a><h3>

</form>

</html>


 Preview- Click on image


Code-

Note - Save This File as index.html

<html>

<frameset rows="20%,*">

<frame src="heading.html">

<frameset cols="20%,*">

<frame src="link.html">

<frame name="f3">

</frameset>

</frameset>

</html>

Note - Save This File as heading.html

<html>

<body>

<h2 align=right>logout</h2>

<h1 align=center><font size=7>Welcome to lvan Bayross</font></h1>

</body>

</html>

Note - Save This File as link.html

<html>

<body>

<h2><a href="home.html" target="f3">Home</a></h2>

<h2><a href="profile.html" target="f3">Profile</a></h2>

<h2><a href="friend.html" target="f3">Find Friend Request</a></h2>

</body>

</html>

Note - Save This File as home.html

<html>

<body>

<h2>Raj shared this link</h2>

<img height=300px width=500px src="https://s3.amazonaws.com/influencive.com/wp-content/uploads/2019/11/19170005/hiking-3775075_1280-e1574274140979.jpg"><br><br>

<input type="button" value="Like">

<input type="button" value="Share">

<input type="button" value="Comment">

</body>

</html>

Note - Save This File as profile.html

<html>

<body>

<h3 align=right><a href="home.html">Home</a><h3>

<h1>Profile Page</h1>

<img src="https://www.arihantayurveda.com/img/t2.jpg">

<p><font size=6>Ivan Bavross</font></p>

<input type=button value="Comment/Message"> <h3>Post <h3>

<p>Timeline  About  Friends</p>

</body>

</html>

Note - Save This File as friend.html

<html>

<body>

<h1>Find Friends Request</h1>

<img height=100px width=100px src="https://codex-themes.com/scalia/wp-content/uploads/2014/09/Faces-400x400px-1_1_18-300x300.jpg">

<p><font size=5>Priya Tyagyi</font>

<input type="button" value="Confirm">

<input type="button" value="Delete">

</p>

<img height=100px width=100px src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcT8RdsUdYf4NijOdfoAn94IAJve-p4RBoA2KA&usqp=CAU">

<p><font size=5>Michel Rock</font>

<input type="button" value="Confirm">

<input type="button" value="Delete">

</p>

<img height=100px width=100px src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQrnI1Xm61F1mJake8AdDHrlJqsAqV_vV7HgA&usqp=CAU">

<p><font size=5>Jessi Misel</font>

<input type="button" value="Confirm">

<input type="button" value="Delete">

</p>

</body>

</html>



 Preview- Click on image

Code-

Note - Save This File as index.html

<!DOCTYPE html>

<html>

<head>

<title>slip8</title>

</head>

<body>

<script type="text/javascript">

function validation()

{

var n,m,a,c,s,p;

n=document.frm.name.value;

m=document.frm.mob.value;

a=document.frm.add.value;

c=document.frm.city.value;

s=document.frm.state.value;

p=document.frm.pin.value;

if (n!=""||m!=""||a!=""||c!=""||s!=""||p!="") 

{

if (!n.match(/^[a-z A-Z]+$/))

{

alert("Invalid name fields");

}

else if(!m.match(/^\d{10}$/))

{

alert("Invalid mob no fields");

}

else if (!p.match(/^\d{6}$/)) 

{

alert("Invalid pincode fields");

}

else

{

alert("Submit succesfully......");

}

}

else

{

alert("Invalid fields");

}

}

</script>

<h1>Student Registration Form</h1>

<form name="frm">

<table>

<tr><td>Name: </td><td><input type="text" name="name"></td></tr>

<tr><td>Mobile No: </td><td><input type="text" name="mob"></td></tr>

<tr><td>Address: </td><td><input type="text" name="add"></td></tr>

<tr><td>City: </td><td><input type="text" name="city"></td></tr>

<tr><td>State: </td><td><input type="text" name="state"></td></tr>

<tr><td>Pincode: </td><td><input type="text" name="pin"></td></tr>

</table><br>

<input type="button" name="b1" onclick="validation()" value="Submit">

<input type="reset" name="b2">

</form>

</body>

</html>


 Preview- Click on image


Code-

Note - Save This File as index.html

<!DOCTYPE html>

<html>

<head>

<title>Slip6</title>

</head>

<body>

<script>

function cal() {

var r1=document.forms[0];

var a=document.frm.txt.value;

var repeat=0;

var c;

if(r1[1].checked)

{

c=prompt("Enter character: ");

for(i=0;i<a.length;i++)

{

if(a[i]==c)

{

repeat=repeat+1;

}

}

alert("Total number of occurences: "+repeat);

}

if(r1[2].checked)

{

var pos=prompt("Enter Position: ");

var ch=a.charAt(parseInt(pos)-1);

if(ch!="")

alert("character at specified position is: "+ch);

else

alert("Please Enter value between "+ a.length);

}

}

</script>

<form name="frm">

Enter the string: <input type="text" name="txt" ><br/>

<input type="radio" name="r1" id="t1">Accept a character from user and count the number of occurrences of that

character in the string.<br/>

<input type="radio" name="r1" id="t2">Accept a Position from user and print the character at specified position.<br/>

<input type="button" onclick ="cal()" name="b1" value="Submit">

</form>

</body>

</html>

 Preview- Click on image

Code-

Note - Save This File as index.html 

<html>
<frameset cols="30%,*">
<frame src="heading.html">
<frame name="f1">
</frameset>
</html>

Note - Save This File as heading.html 

<html>
<body>
  <font size=4><h1>Computer Application Department</h1></font>
  <font size=5>
  <ul>
  <li><a href="bca.html" target="f1">BCA</a><br></li>
  <li><a href="bba.html" target="f1">BBA</a><br></li>
  <li><a href="bsc.html" target="f1">BSC</a><br></li></font>
  </ul>
</body>
</html>

Note - Save This File as bca.html 

<html>
<body>
  <h1>F.Y.B.C.A Exam Time Table</h1>
   <table border=3 cellpadding=10>
     <tr>
<th>Date</th>
<th>Time</th>
<th>Subject code</th>
<th>Subject Name</th>
     </tr>
     <tr>
<td>12/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>101</td>
<td>PPA</td>
     </tr>
     <tr>
<td>13/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>102</td>
<td>MOE</td>
     </tr>
     <tr>
<td>14/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>103</td>
<td>BC</td>
     </tr>
     <tr>
<td>15/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>104</td>
<td>PM</td>
     </tr>
     <tr>
<td>16/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>105</td>
<td>FA</td>
     </tr>
</body>
</html>

Note - Save This File as bba.html 

<html>
<body>
  <h1>F.Y.B.B.A Exam Time Table</h1>
   <table border=3 cellpadding=10>
     <tr>
<th>Date</th>
<th>Time</th>
<th>Subject code</th>
<th>Subject Name</th>
     </tr>
     <tr>
<td>12/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>101</td>
<td>POM</td>
     </tr>
     <tr>
<td>13/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>102</td>
<td>BM</td>
     </tr>
     <tr>
<td>14/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>103</td>
<td>FMA</td>
     </tr>
     <tr>
<td>15/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>104</td>
<td>PM</td>
     </tr>
     <tr>
<td>16/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>105</td>
<td>MM</td>
     </tr>
</body>
</html>

Note - Save This File as bsc.html 

<html>
<body>
  <h1>F.Y.B.S.C Exam Time Table</h1>
   <table border=3 cellpadding=10>
     <tr>
<th>Date</th>
<th>Time</th>
<th>Subject code</th>
<th>Subject Name</th>
     </tr>
     <tr>
<td>12/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>101</td>
<td>POM</td>
     </tr>
     <tr>
<td>13/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>102</td>
<td>BM</td>
     </tr>
     <tr>
<td>14/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>103</td>
<td>FMA</td>
     </tr>
     <tr>
<td>15/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>104</td>
<td>PM</td>
     </tr>
     <tr>
<td>16/10/2015</td>
<td>10:30 am - 1:30 pm</td>
<td>105</td>
<td>MM</td>
     </tr>
</body>
</html>

 Preview-  Click on image

Code-

Note - Save This File as index.html 

<!DOCTYPE html>
<html>
<head>
<title>Factors</title>
<script type="text/javascript">
function factors()
{
var n,a;
a=[];
n=document.frm.txt.value;
for(i=1;i<=n;i++)
{
if(n%i==0)
{
a=a+[i]+",";
}
}
document.getElementById("ans").innerHTML="["+a+"]";
}
</script>
</head>
<body>
<form name="frm">
Number: <input type="text" name="txt">&nbsp;
<input type="button" value="Submit" onclick="factors()">
<p id="ans"></p>
</form>
</body>
</html>

 Preview-    Click on image


Code-

Note - Save This File as index.html 

<html>
 <frameset rows="20%,*">
 <frame src="heading.html">
 <frameset cols="30%,*">
 <frame src="link.html">
 <frame name="f3">
</frameset>
</frameset>
</html>

Note - Save This File as link.html 

<html>
 <body style="background:darkblue; color:white;">
   <h1>City</h1>
   <font size=5>
   <ol>
     <li><a href="Pune.html" target="f3" style="color:white;">Pune</li>
     <li><a href="Banglore.html" target="f3" style="color:white;">Banglore</li>
     <li><a href="Hydrabad.html" target="f3" style="color:white;">Hydrabad</li>
     <li><a href="Delhi.html" target="f3" style="color:white;">Delhi</li>
   </ol>
   </font>
 </body>
</html>

Note - Save This File as Pune.html

<html>
 <body style="background-image: url(https://images.adsttc.com/media/images/51d4/84a8/b3fc/4bea/e100/01d6/large_jpg/Portada.jpg?1372882078); background-position:center center;">
  <h1 style="color:DarkBlue";>Pune</h1>
   <font size=5>
    <ul>
       <li style="color:DarkBlue";>Infosys</li>
       <li style="color:DarkBlue";>TCS</li>
       <li style="color:DarkBlue";>Tech-Mahindra</li>
       <li style="color:DarkBlue";>Persistent</li>
    </ul>
   </font>
 </body>
</html>

Note - Save This File as Banglore.html

<html>
 <body style="background-image:url(https://i.pinimg.com/originals/5f/a4/d7/5fa4d783842f380b19d15489f0c31cbe.jpg); background-size:500px 500px;">
  <h1 style="color:Pink;">Banglore</h1>
   <font size=5>
    <ul>
       <li style="color:Pink;">Cognizant</li>
       <li style="color:Pink;">Google</li>
       <li style="color:Pink;">Microsoft</li>
       <li style="color:Pink;">Infosys</li>
    </ul>
   </font>
 </body>
</html>

Note - Save This File as Hydrabad.html

<html>
 <body style="Background-image:url(http://sf.co.ua/14/05/wallpaper-928219.jpg); background-position:center center;">
  <h1 style="color:white;">Hydrabad</h1>
   <font size=5>
    <ul>
       <li style="color:white;">Capgemini</li>
       <li style="color:white;">Cybage</li>
       <li style="color:white;">Topper</li>
       <li style="color:white;">Cognizant</li>
    </ul>
   </font>
 </body>
</html>

Note - Save This File as Delhi.html

<html>
 <body style="Background-image:url(https://www.sustainableplaces.eu/wp-content/uploads/2017/02/SmartBuilding.jpg); background-size:1000px 500px;">
  <h1 style="color:Yellow;">Delhi</h1>
   <font size=5>
    <ul>
       <li style="color:Yellow;">CHERRY INFOTECH</li>
       <li style="color:Yellow;">Sui-Generis Technologies</li>
       <li style="color:Yellow;">GITS India Solutions</li>
       <li style="color:Yellow;">Infonoble Solutions Pvt Ltd</li>
    </ul>
   </font>
 </body>
</html>
Preview:- Click on Image 
                
click me



Code:- 

Note - Save This File as index.html 

<html>
<frameset rows="20%,*">
<frame src="heading.html">
<frameset cols="20%,*">
<frame src="image.html">
<frame src="link.html">
</frameset>
</frameset>
</html>

Note - Save This File as link.html 

<html>
<body>
<h1>Kitchen & Dining</h1>
<font size=6>
  <ul>
    <a href="kitchen.html"><li>Kichen & Dining</li></a>
    <a href="furnishings.html"><li>Furnishings</li></a>
    <a href="homedecor.html"><li>Home Decor</li></a>
    <a href="homeimprovement.html"><li>Home Improvement</li></a>
  </ul>
</body>
</html>

Note - Save This File as kitchen.html 

<html>
<head>
  <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
  <h1 class="kitchen">Kitchen & Dining</h1>
  <font size=6>
  <ol type="i">
    <li>Cookware</li>
    <li>kitchenware</li>
    <li>Bakeware</li>
    <li>Serveware</li>
  </ol></font>
</body>
</html>

Note - Save This File as image.html 

<html>
<head>
  <link rel="stylesheet" type="text/css" href="main.css">
<head>
<body>
  <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSSe4JIEWAY8bkmg4A2uXYiFkQkvtg-JhoL8w&usqp=CAU" height=60% width=70%>
</body>
</html>

Note - Save This File as homeimprovement.html

<html>
<head>
  <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
  <h1 class="kitchen">Home Improvement</h1>
  <font size=6>
  <ol type="i">
    <li>Ladders</li>
    <li>Padlocks & Hasps.</li>
    <li>Furniture Hardware.</li>
    <li>Door Hardware & Locks.</li>
  </ol></font>
</body>
</html> 

Note - Save This File as homedecor.html

<html>
<head>
  <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
  <h1 class="kitchen">Home Decor</h1>
  <font size=6>
  <ol type="i">
    <li>Wall Decor</li>
    <li>Wall hanging</li>
    <li>Wall painting</li>
    <li>Wall mirrors</li>
  </ol></font>
</body>
</html>

Note - Save This File as heading.html

<html>
<head>
 <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body class="heading">
   <font size=5><h1>Home Shopping</h1></font>
</body>
</html>

Note - Save This File as furnishing.html

<html>
<head>
  <link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
  <h1 class="kitchen">Furnishings</h1>
  <font size=6>
  <ol type="i">
    <li>Curtains</li>
    <li>Pillows & Covers.</li>
    <li>Rugs & Carpets.</li>
    <li>Bed Linen.</li>
  </ol></font>
</body>
</html>

Note - Save This File as main.css

body.heading{
background-color: maroon;
}
h1{
color: white;
text-align: center;
}
img{
border-style: solid;
}
h1.kitchen{
color: #FF5733;
}

 Form:-


Program:-

Imports System.IO

Public Class slip20

    Dim path As String

    Private Sub FontStyleToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FontStyleToolStripMenuItem.Click

        FontDialog1.ShowDialog()

        RichTextBox1.Font = FontDialog1.Font

    End Sub

    Private Sub FontColorToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FontColorToolStripMenuItem.Click

        ColorDialog1.ShowDialog()

        RichTextBox1.ForeColor = ColorDialog1.Color

    End Sub

    Private Sub SaveToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SaveToolStripMenuItem.Click

        If DialogResult.OK = SaveFileDialog1.ShowDialog() Then   ' To check file name is valid or not

            path = SaveFileDialog1.FileName

            RichTextBox1.SaveFile(path, RichTextBoxStreamType.PlainText)

            MsgBox("File save successfully.........")

        End If

       End Sub

    Private Sub OpenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenToolStripMenuItem.Click

        If DialogResult.OK = OpenFileDialog1.ShowDialog() Then   ' To check file name is valid or not

            path = OpenFileDialog1.FileName

            RichTextBox1.Text = (File.ReadAllText(path)).ToString

            MsgBox("File Open successfully.........")

        End If

    End Sub

End Class

Output:-


Design:-

1) Take RichTextBox, MenuStrip, FontDialog, ColorDialog, OpenFileDialog, SaveFileDialog on         design form.

2) Set Menu on MenuStrip.

Theory:-

Imports System.IO - This class contains a File method which is used to read content from a file.

FontDialog1.ShowDialog() - It is use to Display fontDialog. Which helps to select particular font from dialogbox.

FontDialog1.Font - It returns selected Font.

 ColorDialog1.ShowDialog() - It is used to Display color Palette. Which helps to select a particular color from Palette.

ColorDialog1.Color - It returns selected color.

SaveFileDialog1.FileName - It returns filename with path.

RichTextBox1.SaveFile(path, RichTextBoxStreamType.PlainText) - This method save the file at given path and write a text into a file from RichTextBox.

(File.ReadAllText(path)).ToString - This File method is used to read text from a file in a byte. It needs to convert into the string.

Form:-

Program:-

Public Class slip19

    Dim a As String

    Private Sub CutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CutToolStripMenuItem.Click

        TextBox1.Cut()

    End Sub

    Private Sub CopyToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CopyToolStripMenuItem.Click

        TextBox1.Copy()

    End Sub

    Private Sub PasteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PasteToolStripMenuItem.Click

        TextBox2.ReadOnly = False

        TextBox2.Paste()

        TextBox2.ReadOnly = True

    End Sub

    Private Sub CloseToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CloseToolStripMenuItem.Click

        Me.Close()

    End Sub

End Class

Output:-


Design:-

1) Take TextBoxes, Menustrip on Design form.

2) Set Text on Label and Add menus on Menustrip.



 Form:-


Program:-

Public Class slip18

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim a, b As String

        If CheckBox1.Checked = True Then

            a = CheckBox1.Text

        ElseIf CheckBox2.Checked = True Then

            a = CheckBox2.Text

        ElseIf CheckBox3.Checked = True Then

            a = CheckBox3.Text

        End If

        If RadioButton1.Checked = True Then

            b = RadioButton1.Text

        ElseIf RadioButton2.Checked = True Then

            b = RadioButton2.Text

        ElseIf RadioButton3.Checked = True Then

            b = RadioButton3.Text

        End If

        MsgBox("Name : " + TextBox1.Text + " Qualification : " + a + " post: " + b)

    End Sub

End Class

Output:-



Design:-

1) Take Label, Checkboxes, RadioButtons, TextBox, GroupBoxes, and Button on Design Form.

2) Set Text to Labels and Checkboxes.

Form:-



Program:-

Public Class slip17

    Private Sub slip17_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        ComboBox1.Items.Add("BCA")

        ComboBox1.Items.Add("BSC")

        ComboBox1.Items.Add("MCA")

        SplitContainer1.Panel2.Hide()

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        SplitContainer1.Panel2.Show()

        Label26.Text = TextBox1.Text

        Label25.Text = TextBox2.Text

        Label24.Text = TextBox3.Text

        Label23.Text = ComboBox1.SelectedItem()

        If RadioButton1.Checked = True Then

            Label22.Text = RadioButton1.Text

        ElseIf RadioButton2.Checked = True Then

            Label22.Text = RadioButton2.Text

        End If

        Label21.Text = DateTimePicker1.Value

        Label20.Text = TextBox4.Text

        Label19.Text = TextBox5.Text

    End Sub

End Class

Output:-

Design:-

1) Take SplitContainer, Button, Labels, TextBoxes, DateTimepicker, Radio buttons on design form. (note - Instead of SplitContainer you can use GroupBox as well But you need to change a code bit. )

2) Set Text on Labels, Buttons, and Radio buttons.

3) On panel 1 arrange some labels as well as TextBoxes, Radio Buttons 

3) On panel 2 arrange All Labels for displaying information about the student.

Newer Posts Older Posts Home

Ads

Pages

ABOUT BLOG

EASY TO CODE

Welcome to Easy to Code, your number one source for all programs.Coding is used for communicating with computers so we're dedicated to providing you the very best solutions. We hope you enjoy our programs as much as we enjoy offering them to you. If you have any questions or comments, please don't hesitate to contact us.

POPULAR POSTS

  • Write a C++ program to create a class Employee which contains data members as Emp_Id, Emp_Name, Basic_Salary, HRA, DA, Gross_Salary. Write member functions to accept Employee information. Calculate and display Gross salary of an employee. (DA=12% of Basic salary and HRA = 30% of Basic salary) (Use appropriate manipulators to display employee information in given format :- Emp_Id and Emp_Name should be left justified and Basic_Salary, HRA, DA, Gross salary Right justified with a precision of two digits)
  • Write a C++ program to create a class which contains single dimensional integer array of given size. Write a member function to display even and odd numbers from a given array. (Use Dynamic Constructor to allocate and Destructor to free memory of an object)
  • Write a C program to accept dimensions length (l), breadth(b) and height(h) of a cuboids and display surface area and volume (Hint : surface area=2(lb+lh+bh ), volume=lbh )
  • Write C program to check whether a input number is Armstrong number or not.
  • Write a C program to accept temperatures in Fahrenheit (F) and display it in Celsius(C) and Kelvin (K) (Hint: C=5.0/9(F-32), K = C + 273.15)

Report Abuse

Translate

Tags

  • C BCA Practical
  • c program
  • cpp programs
  • DS
  • html
  • Java programs
  • Python Programs
  • VB.net

Slider

5/random/slider

Advertisement

Tags

Recent in Recipes

3/Food/post-list
  • Home
  • About
  • Contact
  • Home
  • Programs
  • BCA Practical Programs
  • __C Structure
  • __C++ Programs
  • __Data Structure
  • __HTML CSS JavaScript
  • __Java
  • _Python
  • _SiteMap
  • About US

Menu Footer Widget

  • Home
  • About
  • Contact Us

Popular Posts

  • Write a C program to accept temperatures in Fahrenheit (F) and display it in Celsius(C) and Kelvin (K) (Hint: C=5.0/9(F-32), K = C + 273.15)
    #include<stdio.h> #include<conio.h> void main() {    float fahrenheit,convert;    //Accept temperature      printf("\nEnter...
  • Write a menu driven program to perform the following operations on strings using standard library functions: 1. Length of String 2. Copy String 3. Connect Two Strings 4. Compare two strings
    #include<conio.h> #include<string.h> #include<stdio.h> //To get length of given string void lengthofstring() {    int leng...
  • Write a C program to accept dimensions of a cylinder and display the surface area and volume of cylinder.
    #include<conio.h> #include<stdio.h> void main() { float r,h,v,A; //declare variables r=radius, h=height , v=volume , A=area...

Labels

  • C BCA Practical33
  • c program2
  • cpp programs50
  • DS22
  • html8
  • Java programs22
  • Python Programs10
  • VB.net20

Pages

  • Data Structure
  • Python
  • Java Programs
  • C programs
  • C Structure
  • C++ Programs
  • BCA (2018) C Programs slip Solutions