1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Julia

Exercise

Writing your own functions

You've seen how to write functions. Now it's time to practice and write your own. In this exercise, you'll be writing a function to calculate the cost of a customer's order. Pre-defined is a dictionary restaurant_menu with menu items as keys and their corresponding prices as values, and you, as the restaurant owner, want to use this dictionary mapping to calculate the total price of a customer's order.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • The first step here is to define a function called calculate_order_cost, which should take an unlimited number of arguments called items, as customers can order as much as they want!