Network disconnection
Description
int형 변수 age의 값을 검사해서 age가 19세 이하이거나 60세 이상인 할인 대상인지를 검사하려고 합니다. 7번째 줄의 빈칸을 알맞게 채워넣어, 할인대상이라면 isDiscount에 true를 그렇지 않으면 isDiscount에 false를 저장하도록 만들어 보세요.
Fill type challenge HOWTO
- In the Fill type challenge, you have to fill the blank with appropriate code
- The given code except the blank cannot be edited.
- An error message will be shown in the Result area when you leave the blank empty.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
public class LogicalOperatorExam {
public bool isAgeDiscountable(int age) {
bool isDiscount = false;
if ( ) {
isDiscount = true;
} else {
isDiscount = false;
}
return isDiscount;
}
public static void Main() {
LogicalOperatorExam exam = new LogicalOperatorExam();
Console.WriteLine("15세인 경우 할인대상?: " + exam.isAgeDiscountable(15));
Console.WriteLine("27세인 경우 할인대상?: " + exam.isAgeDiscountable(27));
}
}
Result
Stop
Result of [Run] or [Submit] will be displayed here