Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use IBM Swift sandbox to check it before post it! Please do the extra credit if you can! Thank you! Develop the following struct
please use IBM Swift sandbox to check it before post it! Please do the extra credit if you can! Thank you!
Develop the following struct that represents a Rectangle: struct Rectangie: Customstringconvertiblef var height: Double var width: Double initheight: Double, width: Double) /Istuff goes here /return area of Rectangle func area )->Double! //stuff goes here //return perimeter of Rectangle func perimeterDoublef /Stuff goes here //a textual representation of the circle var description: String i //Stuff goes here Test Code: var r1 = Rectangle (height: 10, width: 20 , print ("Area: (rl.area))" print ("Perimeter: \(rl.perimeter ))") print (rl) Expected output: Area: 200.0 Perimeter: 60.0 height 10.0 width: 20.0 area: 200.0 perimeter: 60.0 Extra Credit (up to 5 points) Add an additio your methods and test your methods, the more credit you will receive nal useful method, or methods to your rectangle struct. You need to briefly explain the purpose of lop test code. The methods should make sense as part of a Rectangle. The more "interestingStep 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