Question: Convert the following Java code to Swift code as directed and provide yourplayground project to show your conversions work1. Write in Swift Code Using an

Convert the following Java code to Swift code as directed and provide yourplayground project to show your conversions work1.

Write in Swift Code Using an array

int[] counts = new int[2*3];

counts[0] = 12;counts[1] = 22;counts[2] = 17;counts[3] = 16;counts[4] = 4;

counts[5] = 11;int sum = 0;

for (int i = 0; i < counts.length; i++)

{sum = sum + counts[i];}

if (counts.length > 0)

{System.out.print(The number of + bacteria colonies is:+ sum);}

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