'전체 글'에 해당되는 글 132건

T002_SmartPhoneContact 전화번호부 간단 입출력

Posted by PeEn
2019. 5. 14. 11:28 Programing/Java
 
package kr.ac.jj.java201562054;

import java.util.Scanner;

public class T002_SmartPhoneContact {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String name,phone;
		int speed_dial;
		
		System.out.println("==연락처 입력==");
		System.out.print("이름:");
		name = scan.next();
		
		System.out.print("휴대폰:");
		phone = scan.next();
		
		System.out.print("단축번호:");
		speed_dial = scan.nextInt();
		
		System.out.println("==연락처 출력==");
		System.out.print("이름 : "+name+"\n"+"휴대폰 : "+phone+"\n"+"단축번호 : "+speed_dial);
		
		
	}

}
 

기본타입과 문자열

Posted by PeEn
2019. 5. 14. 11:20 Programing/Java
  • 논리 타입
    • boolean / 1byte (true, false)
  • 문자 타입
    • char / 2byte (uricode)
  • 정수 타입
    • byte / 1byte (-128~127
    • short / 2byte (-32768~32767)
    • int / 4byte (-2147483648~2147483647) 21억
    • long / 8byte (-9223372036854775808)
  • 실수 타입
    • float / 4byte (-3.4E38~3.4E38)
    • double / 8byte (-1.7E308~1.7E308)
  • 문자열
    • String
      클래스형에서도 String 클래스는 조금 특별합니다. 이 클래스는 참조형에 속하지만 기본적인 사용은 기본형처럼 사용합니다. 그리고 불변하는immutable 객체입니다. String 클래스에는 값을 변경해주는 메소드들이 존재하지만 해당 메소드를 통해 데이터를 바꾼다 해도 새로운 String 클래스 객체를 만들어내는 것입니다. 일반적으로 기본형 비교는 == 연산자를 사용하지만 String 객체간의 비교는 .equals() 메소드를 사용해야 합니다.

T002_AreaCircle 반지름으로 원 넓비 구하는 프로그램

Posted by PeEn
2019. 5. 14. 11:04 Programing/Java
package kr.ac.jj.java201562054;

import java.util.Scanner;

public class T002_AreaCircle {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		
		System.out.println("==원의 넓이 계산 프로그램==");
		System.out.print("반지름(r)=");
		double radius1 = scan.nextDouble();
		
		System.out.print("반지름 "+radius1+"(r)인 원의 넓이는 "+(radius1*radius1*3.14));
	}

}
 

T002_AreaRectangle 가로 세로로 사각형 넓비 구하는 프로그램

Posted by PeEn
2019. 5. 14. 11:03 Programing/Java
package kr.ac.jj.java201562054;

import java.util.Scanner;

public class T002_AreaRectangle {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		
		System.out.println("==사각형 넓이 계산 프로그램==");
		System.out.print("가로(cm)=");
		int width1 = scan.nextInt();
		System.out.print("세로(cm)=");
		int hight1 = scan.nextInt();
		
		System.out.print("가로 "+width1+"cm와 세로 "+hight1+"cm의 사각형 널이는 "+(width1*hight1)+"cm");
		
	}

}
 

'Programing > Java' 카테고리의 다른 글

기본타입과 문자열  (0) 2019.05.14
T002_AreaCircle 반지름으로 원 넓비 구하는 프로그램  (0) 2019.05.14
T002_AdditionDouble  (0) 2019.05.14
S002_Addition 계산  (0) 2019.05.14
S001_Hello World 출력  (0) 2019.05.14

T002_AdditionDouble

Posted by PeEn
2019. 5. 14. 11:00 Programing/Java
  1. T002_AdditionDouble 실수형 합계
package kr.ac.jj.java201562054;

import java.util.Scanner;

public class T002_AdditionDouble {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		
		System.out.println("첫번째 숫자는?");
		double a = scan.nextDouble();

		System.out.println("두번째 숫자는?");
		double b = scan.nextDouble();
		
		double c = a + b;
		
		System.out.println(a+"+"+b+"의 합은 "+c);
		
	}

}
 

S002_Addition 계산

Posted by PeEn
2019. 5. 14. 10:59 Programing/Java
  1. 소스코드
    package kr.ac.jj.Java201562054;
    
    import java.util.Scanner;
    
    public class S002_Addition {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner scan = new Scanner(System.in);
    		int a = scan.nextInt();
    		int b = scan.nextInt();
    		int c = a+b;
    		System.out.println("합은"+c);
    	}
    
    }
    

S001_Hello World 출력

Posted by PeEn
2019. 5. 14. 10:57 Programing/Java
  1. 소스코드
    package kr.ac.jj.Java201562054;
    
    import java.util.Scanner;
    
    public class S001_HelloWorld {
    
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
    		Scanner scan = new Scanner(System.in);
    		String name = scan.next();
    		System.out.println("Hello" + name);
    
    	}
    
    }

Android_RadioGroup switch문 사용 Fragment에서

Posted by PeEn
2019. 4. 8. 03:40 Programing/Java

Fragment 상속받아 사용할 때 Radio버튼을 누를 때 어떤 버튼이 눌렸는지 확인해서 원하는 값을 Toast로 출력하기

FragmentHead.java

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
91
92
93
94
95
96
97
98
99
100
101
package com.example.administrator.serviceproject;
 
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RadioGroup;
import android.widget.Toast;
 
public class FragmentHead extends Fragment {
    static int score;
    View myView;
    public Button button;
    public FragmentHead() {
 
    }
 
    public void toastout(){
        Toast.makeText(getActivity(), score+"점", Toast.LENGTH_LONG).show();
    }
 
 
    @Override
    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        myView = inflater.inflate(R.layout.fragment_head, container, false);
        RadioGroup radioGroup = (RadioGroup) myView.findViewById(R.id.radioGroup);
 
        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
 
                Button radioGroup = (Button)getActivity().findViewById(checkedId);
 
                switch (checkedId) {
                    case R.id.headbutton0:
                        score = 0;
                        toastout();
                         break;
                    case R.id.headbutton1:
                        score = 1;
                        toastout();
                        break;
                    case R.id.headbutton2:
                        score = 2;
                        toastout();
                        break;
                    case R.id.headbutton3:
                        score = 3;
                        toastout();
                        break;
                    case R.id.headbutton4:
                        score = 4;
                        toastout();
                        break;
                    case R.id.headbutton5:
                        score = 5;
                        toastout();
                        break;
                    case R.id.headbutton6:
                        score = 6;
                        toastout();
                        break;
                    case R.id.headbutton7:
                        score = 7;
                        toastout();
                        break;
                    case R.id.headbutton8:
                        score = 8;
                        toastout();
                        break;
                    case R.id.headbutton9:
                        score = 9;
                        toastout();
                        break;
                    case R.id.headbutton10:
                        score = 10;
                        toastout();
                        break;
                    case R.id.headbutton11:
                        score = 11;
                        toastout();
                        break;
                    case R.id.headbutton12:
                        score = 12;
                        toastout();
                        break;
                     default:
                         Toast.makeText(getActivity(), "Error", Toast.LENGTH_LONG).show();
                }
            }
        });
 
 
 
return myView;
}}
cs

fragment_head.xml

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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".FragmentHead">
 
    <LinearLayout
        android:id="@+id/headlinear"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
 
        <TextView
            android:id="@+id/headtitle"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:background="#ffffff"
            android:gravity="center"
            android:text="@string/head"
            android:textAppearance="@style/TextAppearance.AppCompat.Button"
            android:textColor="#000022"
            android:textStyle="bold"
            app:layout_constraintTop_toTopOf="parent"
            tools:layout_editor_absoluteX="0dp" />
 
        <ScrollView
            android:id="@+id/headscroll"
            android:layout_width="match_parent"
            android:layout_height="687dp">
 
            <android.support.constraint.ConstraintLayout
 
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
 
 
                <RadioGroup
                    android:id="@+id/radioGroup"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/headtitle">
 
                    <TextView
                        android:id="@+id/headgroup1"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:background="#9BEF92"
                        android:gravity="center"
                        android:text="@string/headgroup1"
                        android:textAppearance="@style/TextAppearance.AppCompat.Button"
                        android:textColor="#FFFFFF"
                        android:textStyle="bold"
                        app:layout_constraintTop_toTopOf="parent"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton0"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:contentDescription="@string/headonclick"
                        android:text="@string/headbutton0"
                        app:layout_constraintTop_toBottomOf="@+id/headgroup1"
                        tools:layout_editor_absoluteX="16dp" />
 
                    <TextView
                        android:id="@+id/headgroup2"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:background="#9BEF92"
                        android:gravity="center"
                        android:text="@string/headgroup2"
                        android:textAppearance="@style/TextAppearance.AppCompat.Button"
                        android:textColor="#FFFFFF"
                        android:textStyle="bold"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton0"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton1"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton1"
                        app:layout_constraintTop_toBottomOf="@+id/headgroup2"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton2"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton2"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton1"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton3"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton3"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton2"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton4"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton4"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton3"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton5"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton5"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton4"
                        tools:layout_editor_absoluteX="16dp" />
 
                    <TextView
                        android:id="@+id/headgroup4"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:background="#9BEF92"
                        android:gravity="center"
                        android:text="@string/headgroup4"
                        android:textAppearance="@style/TextAppearance.AppCompat.Button"
                        android:textColor="#FFFFFF"
                        android:textStyle="bold"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton5"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton6"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton6"
                        app:layout_constraintTop_toBottomOf="@+id/headgroup4"
                        tools:layout_editor_absoluteX="41dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton7"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton7"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton6"
                        tools:layout_editor_absoluteX="27dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton8"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton8"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton7"
                        tools:layout_editor_absoluteX="16dp" />
 
                    <TextView
                        android:id="@+id/headgroup3"
                        android:layout_width="match_parent"
                        android:layout_height="50dp"
                        android:background="#9BEF92"
                        android:gravity="center"
                        android:text="@string/headgroup3"
                        android:textAppearance="@style/TextAppearance.AppCompat.Button"
                        android:textColor="#FFFFFF"
                        android:textStyle="bold"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton8"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton9"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
 
                        android:text="@string/headbutton9"
                        app:layout_constraintTop_toBottomOf="@+id/headgroup3"
                        tools:layout_editor_absoluteX="16dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton10"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton10"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton9"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton11"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton11"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton10"
                        tools:layout_editor_absoluteX="0dp" />
 
                    <RadioButton
                        android:id="@+id/headbutton12"
                        android:layout_width="match_parent"
                        android:layout_height="60dp"
                        android:text="@string/headbutton12"
                        app:layout_constraintTop_toBottomOf="@+id/headbutton11"
                        tools:layout_editor_absoluteX="0dp" />
 
                </RadioGroup>
 
 
            </android.support.constraint.ConstraintLayout>
        </ScrollView>
    </LinearLayout>
</FrameLayout>
cs

[엑셀파일]A-02, 일별 수입 지출 내역 & 통계 자동화

Posted by PeEn
2018. 2. 16. 11:35 고객센터/엑셀 상품구매 및 의뢰

PeEn의 재능판매소에 오신것을 환영합니다.

귀하의 페이지는 Excel 프로그램의 회계, 자동화, 수정 등의 상품을 업로드라고 있으며

문의를 통해 맞춤 제작을 지원합니다. 


이용방법

 

 

1. 기본 상품

 

- 원하는 상품 이미지와 상품명을 확인합니다.

- 상품 신청서를 작성합니다.

- 상품 신청서에 기입한 입금자 명으로 입금합니다.

- 오픈카톡으로 입금자명과 상품명을 보냅니다.

- 상품 신청서에 작성한 이메일을 통해 상품을 받습니다.

 

2. 의뢰상품

 

- 오픈카톡을 통해 자세한 설명과 시안 및 파일을 통해 의뢰합니다.

- 제작자와 상의 후 상품 신청서를 작성합니다.

- 상품 신청서에 기입한 입금자 명으로 입금합니다.

- 오픈카톡으로 입금자명과 상품명을 보냅니다.

- 상품 신청서에 작성한 이메일을 통해 상품을 받습니다.


상품 / A-02, 일별 수입 지출 내역 & 통계

 

 

기본 상품가

15,000\


먼저 오픈 카톡을 통해 상담 후 구매하시면 더욱 좋은 상품과 가격에 받아보실 수 있습니다!

[엑셀파일]A-01, 월별 수입 지출 내역 & 통계 자동화

Posted by PeEn
2018. 2. 16. 10:43 고객센터/엑셀 상품구매 및 의뢰

PeEn의 재능판매소에 오신것을 환영합니다.

귀하의 페이지는 Excel 프로그램의 회계, 자동화, 수정 등의 상품을 업로드라고 있으며

문의를 통해 맞춤 제작을 지원합니다. 


이용방법

 

 

1. 기본 상품

 

- 원하는 상품 이미지와 상품명을 확인합니다.

- 상품 신청서를 작성합니다.

- 상품 신청서에 기입한 입금자 명으로 입금합니다.

- 오픈카톡으로 입금자명과 상품명을 보냅니다.

- 상품 신청서에 작성한 이메일을 통해 상품을 받습니다.

 

2. 의뢰상품

 

- 오픈카톡을 통해 자세한 설명과 시안 및 파일을 통해 의뢰합니다.

- 제작자와 상의 후 상품 신청서를 작성합니다.

- 상품 신청서에 기입한 입금자 명으로 입금합니다.

- 오픈카톡으로 입금자명과 상품명을 보냅니다.

- 상품 신청서에 작성한 이메일을 통해 상품을 받습니다.


상품 / A-01, 월별 수입 지출 내역 & 통계

 

기본 상품가

10,000\


먼저 오픈 카톡을 통해 상담 후 구매하시면 더욱 좋은 상품과 가격에 받아보실 수 있습니다!