Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is done i swift playgrounds, how to i go about doing this? confused how i would add to it since ita a constant let
this is done i swift playgrounds, how to i go about doing this? confused how i would add to it since ita a constant "let"
Create a variable total of type Double set to 0. Then loop through the dictionary, and add the value of each integer and double to your variable's value. For each string value, add 1 to the total. For each boolean add 2 to the total if the boolean is true, or subtract 3 if it's false. Print the value of total. var total: Double - 0 44 for (key, value) in SomeDict 45 if value !nt { 46 47 48 49 total value Cannot assign to value: 'value' is a 'let' constant Binary operator'+ cannot be applied to operands of type 'Double' and 'Any' Create a variable tota12 of type Double set to 0. Loop through the collection again, adding up all the ntegers anddoubles. For each strting that you come across during the loop, atempt to convert the string into a number, and add that value to the total. Ignore booleans. Print the total. 53 54 page 1 of 2 | Next: App Exercise - Workout TypesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started