Invitations and gifts

Report a typo

Mr. Groundhog is throwing a party. He’s known for his pragmatism, so only those who bring a gift will be allowed to attend the party. And, of course, a guest must have an invitation.

Write a program that checks if a guest should be allowed at the party. The program should read two booleans, each on a separate line:

  • One showing whether the guest has an invitation;

  • Another indicating if the guest brought a gift.

Print true if both conditions are met and false if not.

Sample Input 1:

true
true

Sample Output 1:

true

Sample Input 2:

true
false

Sample Output 2:

false
Write a program in Kotlin
fun main() {
val invitation = readLine().toBoolean() // read other value in the same way
// write your code here
}
___

Create a free account to access the full topic