-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMOS_TEST.java
More file actions
56 lines (46 loc) · 1.4 KB
/
Copy pathMOS_TEST.java
File metadata and controls
56 lines (46 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package MOS;
import javax.swing.*;
import java.lang.*;
public class Mos_Test
{
public void main()
{
String nama = null;
String nomatrix = null;
nama = JOptionPane.showInputDialog ("Nama Anda?");
nomatrix = JOptionPane.showInputDialog ("Umur?");
int pilih;
pilih = choice();
while (pilih <= 0 || pilih >= 0)
{
if (pilih == 1)
{
Mos_Word baru = new Mos_Word();
baru.startword();
pilih = choice();
}
else if (pilih == 2)
{
Mos_Excel baru = new Mos_Excel();
baru.startexcel();
pilih = choice();
}
else if (pilih == 0)
{
JOptionPane.showMessageDialog(null, "Terima Kasih");
System.exit(0);
}
else
{
JOptionPane.showMessageDialog(null,"Maaf, pilihan anda tiada dalam Menu..\n Sila cuba lagi");
pilih = choice();
}
}
}
public static int choice()
{
int pilihan;
pilihan = Integer.parseInt (JOptionPane.showInputDialog ("Selamat Datang" + "\n Latihan Set Soalan MOS" +"\n1 - MOS WORD" + "\n2 - MOS EXCEL" + "\n0 - Keluar"));
return pilihan;
}
}