# Description
# At the final stage, you will improve your simple bot 
# so that it can give you a test and check your answers. 
# The test should be a multiple-choice quiz about programming. 
# Your bot has to repeat the test until you answer correctly 
# and congratulate you upon completion.

# Objective
# Your bot can ask anything you want, but there are two rules for your output:

# the line with the test should end with the question mark character;
# an option starts with a digit followed by the dot (1., 2., 3., 4.)
# If a user enters an incorrect answer, the bot may print a message:

# `Please, try again.`
# The program should stop on the correct answer and print `Congratulations, have a nice day! at the end`.

# Example
# The greater-than symbol followed by space (> ) represents the user input. Notice that it's not the part of the input.

# Example 1: a dialogue with the new version of the bot

# `Hello! My name is Aid.`
# `I was created in 2020.`
# `Please, remind me your name.`
# > Max​​​​​​​
# `What a great name you have, Max!`
# `Let me guess your age.`
# `Tell me remainders of dividing your age by 3, 5 and 7.`
# > 1
# > 2
# > 1
# `Your age is 22; that's a good time to start programming!`
# `Now I will prove to you that I can count to any number you want.`
# > 5
# `0 !`
# `1 !`
# `2 !`
# `3 !`
# `4 !`
# `5 !`
# `Let's test your programming knowledge.`
# `Why do we use methods?`
# `1. To repeat a statement multiple times.`
# `2. To decompose a program into several small subroutines.`
# `3. To determine the execution time of a program.`
# `4. To interrupt the execution of a program.`
# > 4
# `Please, try again.`
# > 2
# `Completed, have a nice day!`
# `Congratulations, have a nice day!`
# `The program must end with the Congratulations, have a nice day! message.`

# Use the provided template to simplify your work. 
# You can change the text if you want. 
# Please note that we use functions to make it easy to understand the program 
# and add new code to it or edit later.

def greet(bot_name, birth_year):
    print("Hello! My name is " + bot_name + ".")
    print("I was created in " + birth_year + ".")


def remind_name():
    print("Please, remind me your name.")
    name = input()
    print("What a great name you have, " + name + "!")


def guess_age():
    print("Let me guess your age.")
    print("Enter remainders of dividing your age by 3, 5 and 7.")

    rem3 = int(input())
    rem5 = int(input())
    rem7 = int(input())
    age = (rem3 * 70 + rem5 * 21 + rem7 * 15) % 105

    print("Your age is " + str(age) + "; that's a good time to start programming!")


def count():
    print("Now I will prove to you that I can count to any number you want.")

    num = int(input())
    curr = 0

    while curr <= num:
        print(curr, "!")
        curr = curr + 1


def test():
    print("Let's test your programming knowledge.")
    print("Why do we use methods?")
    print("1. To repeat a statement multiple times.")
    print("2. To decompose a program into several small subroutines.")
    print("3. To determine the execution time of a program.")
    print("4. To interrupt the execution of a program.")
    
    option = input()
    
    if (option != "2"):
        print("Please, try again.")
        test()
    else:
        print("Completed, have a nice day!")


def end():
    print("Congratulations, have a nice day!")


greet("Aid", "2020")
remind_name()
guess_age()
count()
test()
end()
