Basic (1)

You have to program several functions. In each case, few lines of code
are enough.

1.  Write a function @welcome(name)@ that prints a personalized greeting
    message. Follow the pattern of the example below.

2.  Write a function @max_min(x, y)@ that returns the maximum and the
    minimum of two integer numbers x and y.

3.  Write a function @integer_division(a, b)@ that returns the quotient
    and remainder of the integer division of a by b. Numbers a and b are
    non negative integers and b ≠ 0

4.  Write a function @digit_count(n)@ that given a natural number n
    returns its number of digits.

5.  Write a function @leading_hand(h, m)@ that given integers 0 ≤ h < 24
    and 0 ≤ m < 60 representing a digital hour prints the leading hand
    of an analogical watch pointing out that hour. Depending on value
    parameters the function prints either "hour hand", "minute hand" or
    "draw". Leading hand is the one closest to 12 following the
    clockwise rotation. We assume hour hand has only 12 possible
    configurations and minute hand has 60.

6.  Write a function @update_arrival(h, m, d)@ that given integers
    0 ≤ h < 24 and 0 ≤ m < 60 representing a flight time arrival and
    d ≥ 0 representing a delay in minutes returns the updated time
    arrival.

Scoring

Last two functions counts 20 points each one. Previous ones counts 15
points.

Sample session

Problem information

Author: Jorge Castro

Generation: 2026-01-25T17:12:29.859Z

© Jutge.org, 2006–2026.
https://jutge.org
