Program mengisi dan menampilkan variabel di layar
1 | <?php |
2 | $npm= "1111282"; |
3 | $nama = 'zay'; |
4 |
5 | echo "NPM : " . $npm. "<br>"; |
6 | echo "Nama : $nama"; |
7 | ?> |
sekedar untuk belajar
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.
1 | <?php |
2 | $npm= "1111282"; |
3 | $nama = 'zay'; |
4 |
5 | echo "NPM : " . $npm. "<br>"; |
6 | echo "Nama : $nama"; |
7 | ?> |
01 | <?php |
02 | $nim = "0411500400"; |
03 | $nama = 'Chotimatul Musyarofah'; |
04 | $umur = 23; |
05 | $nilai = 82.25; |
06 | $status = TRUE; |
07 |
08 | echo "NIM : " . $nim . "<br>"; |
09 | echo "Nama : $nama<br>"; |
10 | print "Umur : " . $umur; print "<br>"; |
11 | printf ("Nilai : %.3f<br>", $nilai); |
12 | if ($status) |
13 | echo "Status : Aktif"; |
14 | else |
15 | echo "Status : Tidak Aktif"; |
16 | ?> |
|
01
|
import java.awt.*;
|
|
|
02
|
import java.awt.event.*;
|
|
|
03
|
import javax.swing.*;
|
|
|
04
|
|
|
|
05
|
public class
Painter extends JFrame {
|
|
|
06
|
private int
pointCount = 0;
|
|
|
07
|
private Point points[] = new
Point[1000];
|
|
|
08
|
|
|
|
09
|
public Painter () {
|
|
|
10
|
super ("Program menggambar sederhana");
|
|
|
11
|
|
|
|
12
|
getContentPane().add(new JLabel("Drag mouse to draw"),
BorderLayout.SOUTH);
|
|
|
13
|
|
|
|
14
|
addMouseMotionListener
(
|
|
|
15
|
new MouseMotionAdapter() {
|
|
|
16
|
public void
mouseDragged
(MouseEvent e) {
|
|
|
17
|
if (pointCount < points.length) {
|
|
|
18
|
points[pointCount]
= e.getPoint();
|
|
|
19
|
++pointCount;
|
|
|
20
|
repaint();
|
|
|
21
|
}
|
|
|
22
|
}
|
|
|
23
|
}
//end of anonymous class
|
|
|
24
|
);
//end method addMotionListener
|
|
|
25
|
|
|
|
26
|
setSize
(300,150);
|
|
|
27
|
setLocationRelativeTo(null);
|
|
|
28
|
setVisible(true);
|
|
|
29
|
}
|
|
|
30
|
|
|
|
31
|
public void
paint (Graphics g) {
|
|
|
32
|
super.paint(g);
|
|
|
33
|
for (int
i = 0; i <
points.length && points[i] != null; i++) {
|
|
|
34
|
g.setColor(Color.red);
|
|
|
35
|
g.fillOval
(points[i].x, points[i].y, 4,4);
|
|
|
36
|
}
|
|
|
37
|
}
|
|
|
38
|
|
|
|
39
|
public static
void main (String args[]) {
|
|
|
40
|
Painter
test = new Painter();
|
|
|
41
|
test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
42
|
}
|
|
|
43
|
}
|