Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

En el archivo Swift, escriba un programa para leer el objeto JSON que contiene una clave de datos y el valor es una cadena que

En el archivo Swift, escriba un programa para leer el objeto JSON que contiene una clave de datos y el valor es una cadena que contiene elementos en el formato: key=STRING, age=INTEGER. Su objetivo es contar cuntos elementos existen que tienen una edad igual o superior a 50, e imprimir este valor final. Ejemplo Entrada {"data": "key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47"} //el ejercicio comienza aqu import Foundatio struct DataObject: Decodable { let data: String } let JSON = """ {"data": "key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47"} """ let jsonData = JSON.data(using: .utf8)! let dataObject: DataObject = try! JSONDecoder().decode(DataObject.self, from: jsonData) print(dataObject.data)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Students also viewed these Databases questions

Question

2. What potential barriers would you encourage Samuel to avoid?

Answered: 1 week ago