Skip to content

Commit 3b1442f

Browse files
authored
Add files via upload
Signed-off-by: kalyani chaudhari <138003080+misskalyani@users.noreply.github.com>
1 parent 2e7150d commit 3b1442f

13 files changed

+2241
-0
lines changed

A.class

265 Bytes
Binary file not shown.

Applet.zip

14.1 KB
Binary file not shown.

B.class

886 Bytes
Binary file not shown.

Java Selected Slip Sloution.zip

25.5 KB
Binary file not shown.

Java.zip

31.4 KB
Binary file not shown.

SLIP1Q1.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//Q1) Write a Program to print all Prime numbers in an array of ‘n’ elements.(use command line arguments)
2+
class PrNo
3+
{
4+
public static void main (String[] args)
5+
{
6+
int size = args.length,flag=1;
7+
int[] array = new int [size];
8+
for(int i=0; i<size; i++)
9+
{
10+
array[i] = Integer.parseInt(args[i]);
11+
}
12+
System.out.println("\n\nArray Elements Are\n");
13+
for(int i=0;i<size;i++)
14+
{
15+
System.out.print(array[i]+"\t");
16+
}
17+
System.out.println("\n\n\nPrime Numbers Are\n");
18+
for(int i=0; i<size; i++)
19+
{
20+
for (int j=2; j<array[i]; j++)
21+
{
22+
if(array[i]%j==0)
23+
{
24+
flag=0;
25+
break;
26+
}
27+
}
28+
if(flag==0)
29+
System.out.print(array[i]+"\t");
30+
31+
}
32+
}
33+
}
34+
/*OUTPUT::
35+
┌──(kalyani㉿lenovo)-[~/Java]
36+
└─$ java SLIP1Q1.java 1 2 3 4 5 6 7 8 9 10
37+
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
38+
39+
40+
Array Elements Are
41+
42+
1 2 3 4 5 6 7 8 9 10
43+
44+
45+
Prime Numbers Are
46+
47+
4 5 6 7 8 9 10
48+
*/

calculator.java

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
import java.awt.*;
2+
import java.awt.event.*;
3+
class demo extends Frame implements ActionListener
4+
{
5+
TextField t1;
6+
Button b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15,b16;
7+
int ch;
8+
int a,b,c;
9+
demo()
10+
{
11+
setVisible(true);
12+
setSize(200,300);
13+
setLocation(200,300);
14+
//setDefaultCloseOperation(Frame.EXIT_ON_CLOSE);
15+
setLayout(null);
16+
setTitle("Simple Calculator");
17+
18+
t1=new TextField(10);
19+
t1.setBounds(100,50,450,50);
20+
b1=new Button("1");
21+
22+
b2=new Button("2");
23+
24+
b3=new Button("3");
25+
26+
b4=new Button("4");
27+
28+
b5=new Button("5");
29+
30+
b6=new Button("6");
31+
32+
b7=new Button("7");
33+
34+
b8=new Button("8");
35+
36+
b9=new Button("9");
37+
38+
b10=new Button("0");
39+
40+
b11=new Button("+");
41+
42+
b12=new Button("-");
43+
44+
b13=new Button("*");
45+
46+
b14=new Button("/");
47+
48+
b15=new Button("clear");
49+
50+
b16=new Button("=");
51+
Panel p=new Panel();
52+
p.setBackground(Color.pink);
53+
p.setLayout(new GridLayout(4,4,9,9));
54+
p.setBounds(100,120,450,400);
55+
add(t1);
56+
p.add(b7);p.add(b8);p.add(b9);p.add(b11);
57+
p.add(b4);p.add(b5);p.add(b6);p.add(b12);
58+
p.add(b1);p.add(b2);p.add(b3);p.add(b13);
59+
p.add(b15);p.add(b10);p.add(b16);p.add(b14);
60+
add(p);
61+
b1.addActionListener(this);
62+
b2.addActionListener(this);
63+
b3.addActionListener(this);
64+
b4.addActionListener(this);
65+
b5.addActionListener(this);
66+
b6.addActionListener(this);
67+
b7.addActionListener(this);
68+
b8.addActionListener(this);
69+
b9.addActionListener(this);
70+
b10.addActionListener(this);
71+
b11.addActionListener(this);
72+
b12.addActionListener(this);
73+
b13.addActionListener(this);
74+
b14.addActionListener(this);
75+
b15.addActionListener(this);
76+
b16.addActionListener(this);
77+
}
78+
public void actionPerformed(ActionEvent ae)
79+
{
80+
81+
try
82+
{
83+
if(ae.getSource()==b1)
84+
{
85+
t1.setText(t1.getText()+"1");
86+
}
87+
if(ae.getSource()==b2)
88+
{
89+
t1.setText(t1.getText()+"2");
90+
}
91+
if(ae.getSource()==b3)
92+
{
93+
t1.setText(t1.getText()+"3");
94+
}
95+
if(ae.getSource()==b4)
96+
{
97+
t1.setText(t1.getText()+"4");
98+
}
99+
if(ae.getSource()==b5)
100+
{
101+
t1.setText(t1.getText()+"5");
102+
}
103+
if(ae.getSource()==b6)
104+
{
105+
t1.setText(t1.getText()+"6");
106+
}
107+
if(ae.getSource()==b7)
108+
{
109+
t1.setText(t1.getText()+"7");
110+
}
111+
if(ae.getSource()==b8)
112+
{
113+
t1.setText(t1.getText()+"8");
114+
}
115+
if(ae.getSource()==b9)
116+
{
117+
t1.setText(t1.getText()+"9");
118+
}
119+
if(ae.getSource()==b10)
120+
{
121+
t1.setText(t1.getText()+"0");
122+
}
123+
if(ae.getSource()==b11)
124+
{
125+
a=Integer.parseInt(t1.getText());
126+
ch=1;
127+
t1.setText("");
128+
}
129+
if(ae.getSource()==b12)
130+
{
131+
a=Integer.parseInt(t1.getText());
132+
ch=2;
133+
t1.setText("");
134+
}
135+
if(ae.getSource()==b13)
136+
{
137+
a=Integer.parseInt(t1.getText());
138+
ch=3;
139+
t1.setText("");
140+
}
141+
if(ae.getSource()==b14)
142+
{
143+
a=Integer.parseInt(t1.getText());
144+
ch=4;
145+
t1.setText("");
146+
}
147+
if(ae.getSource()==b15)
148+
{
149+
t1.setText(" ");
150+
}
151+
if(ae.getSource()==b16)
152+
{
153+
b=Integer.parseInt(t1.getText());
154+
if(ch==1)
155+
{
156+
c=a+b;
157+
t1.setText(""+a+"+"+b+"="+c);
158+
}
159+
if(ch==2)
160+
{
161+
c=a-b;
162+
t1.setText(""+a+"-"+b+"="+c);
163+
}
164+
if(ch==3)
165+
{
166+
c=a*b;
167+
t1.setText(""+a+"*"+b+"="+c);
168+
}
169+
if(ch==4)
170+
{
171+
c=a/b;
172+
t1.setText(""+a+"/"+b+"="+c);
173+
}
174+
}
175+
}
176+
catch(Exception e)
177+
{
178+
t1.setText("Syntax Error ......!");
179+
}
180+
181+
}
182+
public static void main(String ar[])
183+
{
184+
new demo();
185+
}
186+
}
187+

demo.class

2.78 KB
Binary file not shown.

file.class

706 Bytes
Binary file not shown.

hello.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
$a=9;
3+
$b=8;
4+
$c=$a+$b;
5+
echo("adition=$c");
6+
?>

0 commit comments

Comments
 (0)