Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 2.54 KB

S01-EN-elemental-actions.md

File metadata and controls

17 lines (9 loc) · 2.54 KB

Elemental Actions

  1. E01-inverted-number: Write an algorithm that reads a four-digit number and displays the number in reverse. Example: If the number is 4678, the output should be 8764.

  2. E02-quadratic-roots: Write an algorithm that takes the coefficients a, b, and c of a quadratic equation (ax² + bx + c = 0) as input and prints the values of x. Assume that the equation always has real number solutions.

  3. E03-binary-to-decimal: Write an algorithm that converts a four-bit binary number to a decimal number. Example: If 1011 is input, the result should be 11.

  4. E04-clock-angle: Let's consider an analog clock (with hands). Given the exact time (hours and minutes), write an algorithm that calculates the angle between the clock hands. Example: At 3:00, the angle will be 90 degrees. At 3:15, the angle will be 7.5 degrees.

  5. E05-frog-jumps: Jose and Pedro are two frogs. Jose can jump J centimeters, and Pedro can jump P centimeters. Assuming both frogs start jumping from the same point (and in the same direction), create an algorithm to determine if the frogs will meet at the same point before Jose completes K jumps.

  6. E06-line-intersection: Given the equations of two non-parallel lines y = m1x + b1 and y = m2x + b2, write an algorithm to calculate their point of intersection.

  7. E07-multiplication-table: Write a program that displays the multiplication table for a number entered by the user. Example: If the user enters 5, the program should show the table for 5 (5x1, 5x2, ..., 5x10).

  8. E08-pirate-coordinates: After a maritime accident, a castaway wakes up on a deserted island. While exploring it, he finds a bottle with a scroll inside, which reads: "If you decipher the hidden message, you will find a way to leave this place." On the back of the scroll, there are three 4-digit numbers. After a few minutes, the castaway discovers a Cartesian plane on the scroll and a phrase written with special ink that reveals itself when in contact with water. The phrase reads: "In the center of the triangle, you will find the answer." After reading this information, he realizes that by separating the previous numbers into pairs (x, y) and drawing them on the plane connected by lines, a triangle will be formed. The only task left is to calculate the centroid of the triangle to find the point on the island where the mysterious secret is located. A program is required to simulate the process of deciphering the message, reading the 3 numbers, and outputting the coordinates of the centroid.