YJ_Scribbles

#HW01_계산기만들기 본문

프로그래밍/앱인벤터_교양

#HW01_계산기만들기

오뀨기 2020. 10. 10. 05:54

★ 계산기 만들기

 

 

 

★ 디자인하기

1. Screen 설정 변경

ㅇ Theme 바꾸기

   - [Components -> Screen1 선택 : Properties -> Theme -> "Device Default" 선택]

 

ㅇTitle 바꾸기

     - Properties -> Title -> "사칙계산기"로 변경

 

ㅇ 정렬

   - Properties -> AlignHorizontal -> "Center" 선택

   - Properties -> AlignVertical -> "Center" 선택

 

ㅇ 배경색

   - Properties -> BackgroundColor -> "Pink" 선택

 

 

 

2. Image넣기

ㅇ Layout 추가하기

   - Layout 선택 : [Palette -> Layout -> "HorizontalArrangement"] 선택 후 드래그

   - Layout 넓이: [Properties -> Width -> "Fill Parent"] 선택

   - Layout 정렬 : [Properties -> AlignHorizontal -> "Center"] 선택

 

ㅇ Image 추가

   - 이미지 추가 : [Palette -> UserInterface -> "Image" 선택 후 "Layout"]으로 드래그

   - 이미지 업로드 : [Properties -> Picture -> Upload File]

   - 이미지 크기 : [Properties -> Width,Height -> "128 pixel"로 설정]

 

 

 

3. 숫자 입력하는 부분

ㅇ Layout 추가하기

   - 레이아웃 선택 : [Palette -> Layout -> "VerticalArrangement"] 선택 후 드래그

   - 레이아웃 사이즈 : [Properties -> Width -> "40 percent"] 선택

 

ㅇ TextBox 2개 추가하기

   - 힌트넣기 : [Properties -> Hint -> "숫자1", "숫자2" 각각 입력]

   - 글자크기 : [Properties -> FontSize -> "30"으로 설정]

   - 정렬 : [Properties -> TextAlignment -> "Center" 설정]

   - 사이즈 : [Properites -> Width -> "Fill parent" 설정]

 

 

 

 

4. 사칙계산 버튼

ㅇ Layout 추가하기

   - Layout 선택 : [Palette -> Layout -> "HorizontalArrangement"] 선택 후 드래그

   - Layout 넓이: [Properties -> Width -> "80 percent"] 선택

   - Layout 정렬 : [Properties -> AlignHorizontal -> "Center"] 선택

 

ㅇ Button 4개 추가하기

   - 사이즈(4개 모두) : [Properties -> Width -> "Fill parent" 선택]

   - 글자크기(4개 모두) : [Properties -> FontSize -> "35"으로 설정]

 

 

 

 

5. 결과출력하기

ㅇ Layout 추가하기

   - Layout 선택 : [Palette -> Layout -> "HorizontalArrangement"] 선택 후 드래그

   - Layout 정렬 : [Properties -> AlignHorizontal -> "Center"] 선택

 

ㅇTextBox 추가하기

   - 힌트 : [Properties -> Hint -> "결과" 작성]

   - 글자크기 : [Properties -> FontSize -> "35"으로 설정]

   - 정렬 : [Properties -> TextAlignment -> "Center" 설정]

 

 

 

6. Component 이름바꾸기

   - TextBox1 -> "txtNo1"

   - TextBox2 -> "txtNo2"

   - Button1 -> "btnPlus"

   - Button2 -> "btnMinus"

   - Button3 -> "btnMul"

   - Button4 -> "btnDiv"

   - TextBox3 -> "txtResult"

 

 

 

 

 

 

★ 코딩하기

1. 더하기 버튼

 

 

 

2. 빼기 버튼

 

 

3. 곱하기 버튼

 

 

4. 나누기 버튼

 

 

 

 

 

 

 

★ 실행하기

 

 

 

 

 

 

 

 

 

'프로그래밍 > 앱인벤터_교양' 카테고리의 다른 글

#08_두더지잡기 게임  (0) 2020.10.21
#07_디지털시계  (0) 2020.10.21
#05_구구단게임  (0) 2020.10.09
#04_2_나침반앱 만들기  (0) 2020.10.05
#04_1_만보기 만들기  (0) 2020.10.04