Question: In the main function, you will: Ask the user how many treasures you would like to find. For each treasure, you will ask the user

In the main function, you will:
Ask the user how many treasures you would like to find.
For each treasure, you will ask the user how much that treasure is worth as floating point numbers.
Store that value into a list.
After you gather all the information, pass the list into a function named calc_total.
Capture the value returned by calc_total (the total amount of all treasures).
Print if that value is enough to pay your tuition.
If that value is not enough, do not print anything.
Note: this function must be called main
In the calc_total function:
Take in a list of floating point numbers
Iterate through the list, adding the values together (Note: you may not use the sum function!)
Return the result
Note: this function must be called calc_total
Match the text in the following example precisely, including punctuation.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!