Question: What will the code output when the program is run? Checking score: [55, 28, 108, 92, 14] Checking score 55 What are individual scores, bonusScore,

  1. What will the code output when the program is run?

Checking score: [55, 28, 108, 92, 14]

Checking score 55

  1. What are individual scores, bonusScore, baseScore, and teamScore? Constants, local/global variables, parameters or Local/global arrays? In addition, state their types respectively.

Identifier

Description

individualScores

bonusScore

baseScore

teamScore

  1. What do you think the difference is between the keywords let and var? Hint: have a look at how they are used in the code.

Answer the above questions based on the program as below:

  1. Program 3 - Swift let individualScores let bonusScore = 5 let baseScore = 2 var teamScore = 0 print( 

Program 3 - Swift let individualScores let bonusScore = 5 let baseScore = 2 var teamScore = 0 print("Checking score: \(individual Scores)") for score in individualscores { } [55, 28, 108, 92, 14] print("Checking score \(score)") if score> 50 { teamScore + bonusScore } else { } teamScore + baseScore print (teamScore)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 The code is written in Swift and will output the following Checking score 55 28 108 92 14 Checking ... View full answer

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 Banking Questions!