Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Guys please please please I already posted this question three times but no one answered. Please use IBM sandbox to write the code for both
Guys please please please I already posted this question three times but no one answered. Please use IBM sandbox to write the code for both PART 1 AND part 2 separately. The last page is a sample of the code. Thank you!
e Krantz Biological Laboratory Part I The Stats Struct mplement a Swift struct called stats that hold an array of Doubles as its data and offers basic statistical operations on that data. The specs for the Stats class are: struct Stats let values: [Double] init (values: [Double]) func sum->Double func mean ) ->Double func median()Duble func standardDeviationDouble func isPrime (number: Int) >Bool func primes )-Int] func five) -(smallest: Double, ql: Double, mean: Double, q3: Double, largest: Double) Hints: Your task is to repackage the individual statistics functions you have already written into a class. .You also need to write the primes method. primes takes the values Array, creates an Array of Ints by truncation the array elements, and returns a sorted array of the numbers from that array that are prime. Numbers may only appear once. Hints on primes will be given in class. You are also responsible for writing code that tests your stats struct. We will discuss in class how to develop a reasonable test for the stats struct
Step 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