# YAML solutions ## Exercise 1 Write a YAML that stores the following information (a different JSON for each item) 1. A student named Joan Garcia from València and his birth date is 24th of February. ```yaml student: name: Joan surname: Garcia city: València birth_date: day: 24 month: 02 (or February) ``` 2. A list of the following restaurants: - Bar Pasqual is a tapes bar in Av. Blsco Ibáñez, 232, València. Its owner is Marc Alcover. - Restaurant Meravelles is a menu restaurant located in Av. Regne de València, 111, València, owned by Maria Pasqual. - Racó de l'Avia is a menu restaurant in Av Roma, 221, Barcelona owned by Alba Puig. ```yaml establishments: - name: Bar Pasqual type: tapes address: street: Av. Blasco Ibáñez number: 232 city: València owner: Marc Alcover - name: Restaurant Meravelles type: menu address: street: Av. Regne de València number: 111 city: València owner: Maria Pasqual - name: Racó de l'Àvia type: menu address: street: Av. Roma number: 221 city: Barcelona owner: Alba Puig ``` 3. A list of art from a museum: - "Der Kuss" its a painting from Gustav Klimt painted in 1907. - "Gernica" its a mural from Pablo Picasso painted in 1937. - "David" its a marble sculpture from Michelangelo created in 1504. ```yaml artworks: - name: Der Kuss type: painting year: 1907 author: Gustav Klimt - name: Gernica type: mural year: 1937 author: Pablo Picasso - name: David type: marble sculpture year: 1504 author: Michelangelo ``` ## Exercise 2 Choose a mobile phone and write down a detailed specification in YAML format. (Battery, CPU, RAM, Storage, Cameras, connectivity, ...) Include the links where you found the information in the document. Source: [https://www.mi.com/es/product/mi-11/specs](https://www.mi.com/es/product/mi-11/specs) ``` phone: brand: Xiaomi model: Mi 11 ram: 8 GB storage: 256 GB size: height: 164.3 mm width: 74.6 mm thicknessL 8.06 mm weight: 196 g screen: type: WQHD+ 6,81" AMOLED DotDisplay resolution: 3200x1440 aspect_ratio: 20:9 cpu: type: Qualcomm® Kryo™ 680, 5 nm frequency: 2.84GHz battery: size: 4600 mAh charge: - 55W wired turbo charging - 50W wireless turbo charging - 10W reverse wireless charging cameras: - type: wide angle camera position: rear megapixels: 108 - type: ultra-wide angle camera position: rear megapixels: 13 - type: telemacro camera position: rear megapixels: 5 - type: in-display selfie camera position: frontal megapixels: 20 ``` ## Exercise 3 Write a YAML document with information about the following operating systems: - Last Windows - Last macOS - Last Ubuntu Desktop - Last Ubuntu Server - Last Fedora Workstation - Last Kali Linux It must include: mantainer, last version, minimum and recommended requieremts and a description about each operating system. ``` operating-systems: - name: "Ubuntu Desktop" mantainer: "Canonical" version: "21.10" minimum-requieremts: cpu: 2GHz dual core ram: 4GiB storage: 8.6GB screen: 1024x768 resolution description : > This is the description of the Ubuntu 21.10 operatig system - name: "Windows" mantainer: "Microsoft" version: "11" minimum-requieremts: cpu: ... ram: ... storage: ... screen: ... description : > This is the description of the Windows 11 operatig system ``` ## Exercise 4 Write a YAML document with information about the following objects: ![vehicles](../img/vehicles.png) ```yaml vehicles: - type: suv colors: - white - black passengers: 5 brand: Range Rover - type: van colors: - white passengers: 3 - type: motorcycle colors: - red - white - black passengers: 2 brand: Opel - type: suv colors: - red - black passengers: 5 brand: Range Rover - type: motorcycle colors: - green - black passengers: 2 - type: toy car colors: - red passengers: 2 brand: Ferrari - type: bicycle colors: - black passengers: 1 - type: bus colors: - blue passengers: a lot ```