Introduction to Programming 2024/2025 (CC1024) - DCC/FCUP

Practical Class #03 - Conditionals and Program Flow (07/10 to 11/10)


Exercises for submission

In what concerns the "exercises during classes" component of the evaluation, the exercises that you can submit for this class are:

Deadline for submission: October 26th (submit to IP's Mooshak)

You are encouraged to talk to the professors and your colleagues if you encounter difficulties. However, any more direct help that you receive should be acknowledged in the comments of the code you submit.
After the deadline the problems will still be available on Mooshak, but the submissions will not count towards your grade.
Each practical class is worth 10% of your final component for exercices during class. Since there will be 11 classes with submissions, you can achieve maximum grade even without doing all classes.
For a problem to count you must pass all tests (that is, to have an accepted). Even if you solve all problems, the maximum on one class is 100%.
To obtain 100% it will always be enough to solve the main exercises.


With the exercises in this class you will develop the following skills:

  1. Explore the usage of boolean expressions (and operators such as and, or)
  2. Explore the usage of of conditionals (such as if, elif, else)
  3. Explore the usage of program flow cycle instructions (such as for, while)
  4. Consolidate your knowledge of coding, debugging and problem solving

If you feel stuck, go back and revise the lectures T02: The basics | T03: Conditionals | T04: Program Flow


1) Mooshak Submissions (main exercises)


Read the statements, code and try to submit Accepted solutions to all of the following problems. Don't forget to test first on your computer!

  1. [IP009] Absolute-ly
  2. [IP010] Big and Bigger
  3. [IP011] Best of 3
  4. [IP012] FizzBuzz
  5. [IP013] Grading Papers
  6. [IP014] More Circle Math
  7. [IP015] Buy Me Flowers
  8. [IP016] For How Long?
  9. [IP017] Multiply Mayhem!
  10. [IP018] Spend the Night

We encourage you to speak with your colleagues and with your professors if you need help (including using Discord), but be aware that you should be trying to solve the exercises by yourself!

You get from a course what you invest on it and by actually trying to solve the problems you will learn a lot (including some of the things you will not get correct the first time, which will become lessons you will not forget).

This course is all about "putting your hands dirty" in terms of actually coding, and if you rely on other's code (or tools such as ChatGPT) you will be most of all just fooling yourself... Try to do it and enjoy the rich and dynamic experience we prepared for you! 😊

😁 suprised pikachu...



2) Extra exercises for consolidating your knowledge [extra]

So you enjoyed the main exercises so much, that you want more problems to submit? Don't worry we've gor you covered! Here are some exercises to consolidade your knowledge and to show you are coding for more than simply your grade 😃


Read the statements, code and try to submit Accepted solutions to all of the following problems. Don't forget to test first on your computer!

  1. [IP019] Don't touch me!
  2. [IP020] I am root
  3. [IP021] Sum me up!
  4. [IP022] Perfection

3) Challenge exercises [challenge]

So want more challenges? Here you go! (they are not that hard... don't worry, we have even more interesting exercises for future classes, but for know you are just initiating your journey through the world of coding and algorithms...


Read the statements, code and try to submit Accepted solutions to all of the following problems. Don't forget to test first on your computer!

  1. [IP023] Pointy Business
  2. [IP024] Spin me right round

Happy coding! 😊