
-
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
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90


본문내용
명품 JAVA 프로그래밍 2장 연습문제.hwp
1. 대소문자출력하기
import java.util.Scanner;
public class a{
public static void main(String[] args) {
char s;
System.out.print(\\"문자를 입력하세요:\\");
Scanner in = new Scanner(System.in);
s = in.next().charAt(0);
if(s>=65 && s<=90){
s+=32;
System.out.print(s);
}
else if(s>=97 && s<=122){
s-=32;
System.out.print(s);
}
else
System.out.print(\\"영문자가 아닙니다.\\");
}
}
≪ 그 림 ≫
2. 주민번호출력하기
import java.util.*;
public class b {
public static void main(String[] args) {
int a=0;
Scanner in = new Scanner(System.in).useDelimiter(\\"-\\");
System.out.print(\\"주민등록번호를 입력하세요:\\");
a = in.nextInt();
System.out.print(a);
}
}
≪ 그 림 ≫
3.돈 개수구하기
import java.util.*;
public class c {
public static void main(String[] args) {
int a;
int[] c={0,0,0,0,0,0,0,0};
Scanner in = new Scanner(System.in);
System.out.print(\\"값을 입력하세요:\\");
a = in.nextInt();
for(int i=0; i
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
명품 JAVA 프로그래밍 10장 연습문제.hwp
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MyFrame extends JFrame {
public JLabel la;
MyFrame(){
setTitle(\\"asd\\");
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
la = new JLabel(\\"Love Java\\");
la.addMouseListener(new MyMouse());
la.setSize(50,50);
add(la);
setSize(300,200);
setVisible(true);
}
class MyMouse implements MouseListener{
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
la.setText(\\"사랑해\\");
}
@Override
public void mouseExited(MouseEvent e) {
la.setText(\\"Love Java\\");
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub
}
}
public static void main(String[] ages){
new MyFrame();
}
}
1. 대소문자출력하기
import java.util.Scanner;
public class a{
public static void main(String[] args) {
char s;
System.out.print(\\"문자를 입력하세요:\\");
Scanner in = new Scanner(System.in);
s = in.next().charAt(0);
if(s>=65 && s<=90){
s+=32;
System.out.print(s);
}
else if(s>=97 && s<=122){
s-=32;
System.out.print(s);
}
else
System.out.print(\\"영문자가 아닙니다.\\");
}
}
≪ 그 림 ≫
2. 주민번호출력하기
import java.util.*;
public class b {
public static void main(String[] args) {
int a=0;
Scanner in = new Scanner(System.in).useDelimiter(\\"-\\");
System.out.print(\\"주민등록번호를 입력하세요:\\");
a = in.nextInt();
System.out.print(a);
}
}
≪ 그 림 ≫
3.돈 개수구하기
import java.util.*;
public class c {
public static void main(String[] args) {
int a;
int[] c={0,0,0,0,0,0,0,0};
Scanner in = new Scanner(System.in);
System.out.print(\\"값을 입력하세요:\\");
a = in.nextInt();
for(int i=0; i
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
명품 JAVA 프로그래밍 10장 연습문제.hwp
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MyFrame extends JFrame {
public JLabel la;
MyFrame(){
setTitle(\\"asd\\");
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
la = new JLabel(\\"Love Java\\");
la.addMouseListener(new MyMouse());
la.setSize(50,50);
add(la);
setSize(300,200);
setVisible(true);
}
class MyMouse implements MouseListener{
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
la.setText(\\"사랑해\\");
}
@Override
public void mouseExited(MouseEvent e) {
la.setText(\\"Love Java\\");
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub
}
}
public static void main(String[] ages){
new MyFrame();
}
}
소개글