0% found this document useful (0 votes)
4 views5 pages

Registration Form and Programming Examples

The document is a worksheet for Grade 12 Computer Science, covering CSS, JavaScript, and Java programming topics. It includes exercises for applying CSS formatting, validating a registration form using JavaScript, and creating Java classes demonstrating object-oriented programming concepts such as inheritance and polymorphism. The Java programming section features examples of class creation, constructors, and method overloading.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Registration Form and Programming Examples

The document is a worksheet for Grade 12 Computer Science, covering CSS, JavaScript, and Java programming topics. It includes exercises for applying CSS formatting, validating a registration form using JavaScript, and creating Java classes demonstrating object-oriented programming concepts such as inheritance and polymorphism. The Java programming section features examples of class creation, constructors, and method overloading.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Worksheet 2025-26

Subject: Computer
(English Medium)
Grade: 12
 Registration Form

 CSS
1. Apply Border and Text Formatting on given heading
2. Text Formatting on fields of Registration form.
3. Give formatting to the created fields like box, border and text

Java Script
<script>
function validation()
{
var a=[Link];
if(a == "" || a == null)
{
alert("Plz Enter Name");
return false;
}
var b=[Link];
if(b == "" || b == null)
{
alert("Plz Enter Password");
return false;
}
var c=[Link];
if(b != c)
{
alert("Plz Enter Valid Confirm Password");
return false;
}
var d=[Link];
if(d == "" || d == null)
{
alert("Plz Enter Contact Number");
return false;
}
if(isNaN(d))
{
alert("Plz Enter Only Numbers In Contact Number");
return false;
}
if([Link]>10 || [Link] < 10)
{
alert("Plz Enter 10 Digit Contact Number");
return false;
}
var e=[Link][0].checked;
var f=[Link][1].checked;
if(e == false && f == false)
{
alert("Plz Select Gender");
return false;
}
var g=[Link];
if(g == -1)
{
alert("Plz Select City");
return false;
}
}
</script>

 Java Programing
Prog1. Make object based on room class
class room
{
int length,width,height,nwindow;
void setatt(int l,int w,int h,int n)
{
length=l;
width=w;
height=h;
nwindow=n;
}
void display()
{
[Link]("length="+length);
[Link]("width="+width);
[Link]("height="+height);
[Link]("no of window="+nwindow);
}
int area()
{
return length*width;
}
}
public class inherit
{
public static void main(String[] args)
{
room r1=new room();
[Link](10,11,12,2);
[Link]();
[Link]("area of room1="+[Link]());

room r2=new room();


[Link](20,22,22,2);
[Link]();
[Link]("area of room1="+[Link]());
}
}

Prog2. Constructor
class room
{
int length,width,height,nwindow;
room(int l,int w,int h,int n)
{
length=l;
width=w;
height=h;
nwindow=n;
}
void display()
{
[Link]("length="+length);
[Link]("width="+width);
[Link]("height="+height);
[Link]("no of window="+nwindow);
}
int area()
{
return length*width;
}
}
public class inherit
{
public static void main(String[] args)
{
room r1=new room(10,11,12,2);
[Link]();
[Link]("area of room1="+[Link]());
room r2=new room(20,22,22,2);
[Link]();
[Link]("area of room1="+[Link]());
}
}
Prog3. Inheritance
class room
{
int length,width,height,nwindow;
room(int l,int w,int h,int n)
{
length=l;
width=w;
height=h;
nwindow=n;
}
void display()
{
[Link]("length="+length);
[Link]("width="+width);
[Link]("height="+height);
[Link]("no of window="+nwindow);
}
int area()
{
return length*width;
}
}
class classroom extends room
{
int nbench,nseat;
classroom(int l,int w,int h,int n,int nb,int ns)
{
super(l,w,h,n);
nbench=nb;
nseat=ns;
}
void show()
{
[Link]();
[Link]("no of benches="+nbench);
[Link]("no of seats="+nseat);
}
int totseats()
{
return nbench*nseat;
}
}
public class inherit
{
public static void main(String[] args)
{
classroom cr1=new classroom(10,11,12,2,15,2);
[Link]();
[Link]("area of classroom1="+[Link]());
[Link]("total seats in classroom1="+[Link]());
classroom cr2=new classroom(20,22,22,2,25,2);
[Link]();
[Link]("area of classroom2="+[Link]());
[Link]("total seats in classroom2="+[Link]());
}
}
Prog4. polymorphism
class PrintLine
{
static void printline()
{
for(int i=0;i<40;i++)
{
[Link]("*");
}
[Link]();
}
static void printline(int n)
{
for(int i=0;i<n;i++)
{
[Link]("#");
}
[Link]();
}
static void printline(int n,char ch)
{
for(int i=0;i<n;i++)
{
[Link](ch);
}
[Link]();
}
}
public class poly
{
public static void main(String[] args)
{
[Link]();
[Link](30);
[Link](20,'B');
}
}

You might also like