Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

1 The code is written in Swift and will output the following Checking score 55 28 108 92 14 Checking ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Banking questions

Question

What are the assumptions of the test based on the ????-ratio?

Answered: 1 week ago