Professional Documents
Culture Documents
of
Informatics Practices
Class: XII -B
Roll No.:
Index
Sl. Teacher
Topic
No. Sign.
1 Own calculator
2 Eligibilty vote
3 Calculate bill
4 Find day of the week
5 Count number from 1-10
6 Program for combo box
7 Display details of a person
8 Ice cream shop
9 Pizza cafeé
10 Sales shop
11 Loop to print series
12 Program to show nested loop
13 Program to show composite numbers
14 Program to show login process
15 Program for path educo enterprise
16 Program for kiddi land enterprises
17 Sql program for exam
18 Sql program for joint
19 Sql program for joint
20 Sql program for result
21 Program to show class for book
22 Program for sagar electronics
23 HDFC bank
24 Show class for batsman
25 Show palindrome
26 Program to show number of vowels
27 Insertion of data
28 Modification of data
29 Deletion of data
30 Five HTML Program
Solution:
c = a * b;
jTextField3.setText(Integer.toString(c));
}
Question: 2. Write a program to enter age and check eligible for voting
or not.
Solution:
private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int age;
age = Integer.parseInt(jTextField1.getText());
if(age>=18)
jTextField2.setText("Eligible for Voting");
else
jTextField2.setText("Not Eligible for Voting");
}
Solution:
Solution:
Solution:
Question 6: Write a java program to enter bill amount and select type
of member (Platinum -18%, Gold-8%, Silver-5%).
Solution:
jTextField2.setText(Double.toString(disc));
jTextField3.setText(Double.toString(net)); }
Question 7: Write java code to enter person details and store into
textarea.
Solution:
jTextField4.setText("");
jTextArea1.setText("");
}
Question 8: Write java code to select ice cream and enter quantity
then calculate total amount.
Solution:
double price=0.0,amt;
int qty=Integer.parseInt(txtqty.getText());
String ice = (String) list1.getSelectedValue();
if(ice.equals("vanila"))
{
price=100;
}
else if(ice.equals("strawbery"))
{
price=100;
}
else if(ice.equals("butterscatch"))
{
price=150;
}
else if(ice.equals("chocolate"))
{
price=200;
}
else if(ice.equals("tutti-frutti"))
{
price=150;
}
else if(ice.equals("mango"))
{
price=180;
}
txtprice.setText(" "+price);
amt=price*qty;
txtamt.setText((""+amt));
lblresult.setText("you have to pay Rs."+amt);
}
jTextField3.setText(Double.toString(top));
jTextField4.setText(Double.toString(total));
}
Question 10: Write java code to enter four quarter sale amount and
calculate total amount of yearly sales.
Solution:
int a = Integer.parseInt(txt1.getText());
int b = Integer.parseInt(txt2.getText());
int c = Integer.parseInt(txt3.getText());
int d = Integer.parseInt(txt4.getText());
int e = a+b+c+d;
txt5.setText(""+e);
Solution:
Question: 14. Write java program to enter user id and password then
check It is valid or not?
Solution:
import javax.swing.JOptionPane;
private void LoginActionPerformed(java.awt.event.ActionEvent evt) {
String user, pass;
user = jTextField1.getText();
pass = new String(jPasswordField1.getPassword());
if (user.equals("Karan Sharma"))
{
if (pass.equals("delhi36"))
{
JOptionPane.showMessageDialog(null,"Login successfully");
}
else
{
JOptionPane.showMessageDialog(null,"Password Invalid !!!");
}
}
else
{
JOptionPane.showMessageDialog(null,"User ID Invalid");
}
}
Solution:
private void CalculateActionPerformed
(java.awt.event.ActionEvent evt)
{
double basic, overtime,cca,hra,salary, otamount, netamount,days;
if(jRadioButton1.isSelected())
{
// Temporary Employee 250 per day and overtime 50 per hour
days = Double.parseDouble(jTextField7.getText());
overtime = Double.parseDouble(jTextField8.getText());
salary = days*250;
otamount = overtime * 50;
netamount=salary + otamount;
jTextField9.setText(salary+"");
jTextField11.setText(otamount+"");
jTextField10.setText(netamount+"");
}
else if(jRadioButton2.isSelected())
{
basic = Double.parseDouble(jTextField3.getText());
overtime = Double.parseDouble(jTextField4.getText());
cca=500;
otamount = overtime * 75;
hra = basic * 10/100;
salary = basic+cca+hra;
netamount = salary + otamount;
jTextField5.setText(hra+"");
jTextField6.setText(cca+"");
jTextField9.setText(salary+"");
jTextField11.setText(otamount+"");
jTextField10.setText(netamount+"");
}
}
(java.awt.event.ActionEvent evt)
{
jTextField1.setText("");
jTextField2.setText("");
jTextField3.setText("");
jTextField4.setText("");
jTextField5.setText("");
jTextField6.setText("");
jTextField7.setText("");
jTextField8.setText("");
jTextField9.setText("");
jTextField10.setText("");
jTextField11.setText("");
jRadioButton1.setSelected(true);
}
Solution:
Question 19.
Solution:
{
Book b1 = new Book();
b1.Display();
}
}
Question. 22. Design the Sagar Electronics sale the Item (LCD TV -
25000, LED TV - 40000, Music System - 10000, Radio - 2000), and
Calculate Tax (12% of Total) and net Amount.
Solution:
else if(index == 1)
rate = 40000;
else if(index == 2)
rate = 10000;
else
rate = 2000;
total = rate * qty;
tax = total * 12/100;
net = total + tax;
jTextField1.setText(Double.toString(rate));
jTextField3.setText(Double.toString(tax));
jTextField4.setText(Double.toString(net));
}
Question 23. Desgin the HDFC Bank to select the Loan Type with Rate
of Interest ( Car Loan - 10%, House Loan - 8.5%, Education Loan-5%).
and Calculate Interest Amount(Compound Interest) and Net Amount.
Solution:
}
void readdata()
{
bcode = Integer.parseInt(jTextField1.getText());
bname = jTextField2.getText();
inning = Integer.parseInt(jTextField3.getText());
notout = Integer.parseInt(jTextField4.getText());
runs = Integer.parseInt(jTextField5.getText());
}
void displaydata()
{
jTextField6.setText(Integer.toString(batavg));
}
Solution:
private void PalindromeCheckerActionPerformed
(java.awt.event.ActionEvent evt)
{
String str, rev="";
str = jTextField1.getText();
for(int i = str.length()-1; i>=0; i--)
{
rev = rev + str.charAt(i);
}
if(str.equalsIgnoreCase(rev))
jTextField2.setText(str+" is a Palindrome.");
else
jTextField2.setText(str+" is not a Palindrome.");
}
Question 26: Write java code to enter string and count number of
vowels.
Solution:
Solution:
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.JOptionPane;
stmt.close();
con.close();
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e.getMessage());
}
}
Solution:
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.JOptionPane;
catch (Exception e)
{
JOptionPane.showMessageDialog(null,e.getMessage());
}
}
Question: 29. Write java program to delete the student details from
database table.
Solution:
import java.sql.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.JOptionPane;
HTML
<html>
<head>
<title>LAXMI PUBLIC SCHOOL</title>
</head>
<body bgcolor="BLUE" >
<font face="Arial" style="BOLD" color="Black" size="6">
<p align="CENTER"> LAXMI PUBLIC SCHOOL</p>
<img src="A.jpg">
</BODY>
</html>
<html>
<head>
<title>Career Options in Multimedia</title>
</head>
<body bgcolor="PINK" ALINK="BLUE" VLINK="Blue">
<CENTER>
<TABLE BORDER = "5" color = "Green" cellpadding="2" cellspacing="2" width =
"40%">
<CAPTION color="BLUE">Course Charges</CAPTION>
<TR><TH bgcolor = "Cyan">Course Name</TH><TH bgcolor = "Cyan">Monthly
Charges</TH></TR>
<TR><TD>Graphic Designing</TD><TD>Rs.25000</TD></TR>
<TR><TD>Game Designing</TD><TD>Rs.35000</TD></TR>
<TR><TD>Web Designing</TD><TD>Rs.15000</TD></TR>
<TR><TD>Print & Puhlishing</TD><TD>Rs.10000</TD></TR>
</TABLE>
</CENTER>
</BODY>
</html>
<html>
<head>
<title>
Online Games</title>
</head>
<OL>
<LI><A href="puzzle.html">Puzzle Games</A></LI>
<UL TYPE="square">
<LI>Tetris</LI>
<LI>Cubis</LI>
</UL>
<LI><A href="card.html">Card Games</A></LI>
<ul type="i">
<li>Solitaire</LI>
<li>Hearts</LI>
</ul>
<LI><A href="Action.html">Action Games</A></LI>
<ul type="a">
<li>Boom</LI>
<li>Final Assault</LI>
</ul>
</OL>
</CENTER>
</BODY>
</html>
<form method="post"
action="mailto:youremail@email.com">
Select your favorite cartoon characters.<br>
<input type="checkbox" name="toon"
value="Goofy">Goofy<br>
<input type="checkbox" name="toon"
value="Donald">Donald<br>
<input type="checkbox" name="toon"
value="Bugs">Bugs Bunny<br>
<input type="checkbox" name="toon"
value="Scoob">Scooby Doo<br>
</form>
<form method="post"
action="mailto:youremail@email.com">
College Degree?
<select name="degree">
<option>Choose One</option>
<option>Some High School</option>
<option>High School Degree</option>
<option>Some College</option>
<option>Bachelor's Degree</option>
<option>Doctorate</option>
<input type="submit" value="Email Yourself">
</select>
</form>