Help with creating Functions/Loops/Condition

Hey, I'm fairly new to RStudio and have no experience in programming at all. For my next semester, i have to learn the basics to get a passing grade. My tutor gave us assignments, sadly without the codes so we have to figure it out ourselves. I'm overwhelmed and can't get behind some tasks, especially the one i want to ask about right now. I don't even know what commands are best, so i wanted to ask someone with knowledge about it. I'd be very thankfull if someone could help me out, just so i might get a grasp of how a code to this kind of task is supposed to look like:
[redacted]

Hi, welcome!

Homework inspired questions are welcome here, but you have to tell us what have you tried so far? what is your specific problem? We are more inclined towards helping you with specific coding problems rather than doing your work for you. Verbatim reposting of assignments is not permitted

For guidelines about how to properly ask homework related questions here, please read our homework policy.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.