logo
Solve the Module Without Help

Overview:

So you have decided to take on the challenge of skipping the step by step lessons and building the base of Cairo pyramids in one script! You can always go through the step by step lessons if you encounter any issues.

We will assume you have the Cairo fundamentals covered in this module down, so we will get right into the problem.



Your Turn:

We have created a main function with several assertions and some calls to functions that do not exist yet. Your goal is to make the script compile and run successfully. Make sure to read the comments because certain code cannot be modified. The tasks:

  • Mummies love for the area of the base of the pyramid to be equal to 100 times the number of sides of the pyramid. Add a function get_ideal_base_area that will take an input parameter num_pyramid_sides and return the ideal area of the pyramid's base which should be 100 times the number of sides. Return the ideal area in the variable ideal_base_area.
  • Mummies are very particular about the area of the base of their pyramid being ideal. Add a function is_ideal_base_area that will take parameters num_pyramid_sides and base_area and will return 1 if the base area is the ideal area or 0 if it is not.



References:

For official Cairo Docs: $ https://www.cairo-lang.org/docs/$ 


Back

4 / 4


Twitter