| 
									
										
										
										
											2018-11-15 16:37:09 +03:00
										 |  |  | // For more tutorials: https://blog.learngoprogramming.com | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // Copyright © 2018 Inanc Gumus | 
					
						
							|  |  |  | // Learn Go Programming Course | 
					
						
							|  |  |  | // License: https://creativecommons.org/licenses/by-nc-sa/4.0/ | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // --------------------------------------------------------- | 
					
						
							|  |  |  | // EXERCISE: Declare empty arrays | 
					
						
							|  |  |  | // | 
					
						
							| 
									
										
										
										
											2018-11-17 21:56:09 +03:00
										 |  |  | //  1. Declare and print the following arrays with their types: | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | // | 
					
						
							| 
									
										
										
										
											2018-12-05 19:48:28 +03:00
										 |  |  | //    1. The names of your best three friends (names array) | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //    2. The distances to five different locations (distances array) | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //    3. A data buffer with five bytes of capacity (data array) | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //    4. Currency exchange ratios only for a single currency (ratios array) | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //    5. Up/Down status of four different web servers (alives array) | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //    6. A byte array that doesn't occupy memory space (zero array) | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | // | 
					
						
							| 
									
										
										
										
											2018-11-17 21:56:09 +03:00
										 |  |  | //  2. Print only the types of the same arrays. | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | // | 
					
						
							| 
									
										
										
										
											2018-11-17 21:56:09 +03:00
										 |  |  | //  3. Print only the elements of the same arrays. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // HINT | 
					
						
							|  |  |  | //   When printing the elements of an array, you can use the usual Printf verbs. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //   For example: | 
					
						
							|  |  |  | //     When printing a string array, you can use "%q" verb as usual. | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | // | 
					
						
							|  |  |  | // EXPECTED OUTPUT | 
					
						
							| 
									
										
										
										
											2018-11-17 21:56:09 +03:00
										 |  |  | //  names    : [3]string{"", "", "", ""} | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | //  distances: [5]int{0, 0, 0, 0, 0} | 
					
						
							|  |  |  | //  data     : [5]uint8{0x0, 0x0, 0x0, 0x0, 0x0} | 
					
						
							|  |  |  | //  ratios   : [1]float64{0} | 
					
						
							| 
									
										
										
										
											2018-11-17 21:56:09 +03:00
										 |  |  | //  alives   : [4]bool{false, false, false, false} | 
					
						
							|  |  |  | //  zero     : [0]uint8{} | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //  names    : [3]string | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | //  distances: [5]int | 
					
						
							|  |  |  | //  data     : [5]uint8 | 
					
						
							|  |  |  | //  ratios   : [1]float64 | 
					
						
							| 
									
										
										
										
											2018-11-17 21:56:09 +03:00
										 |  |  | //  alives   : [4]bool | 
					
						
							|  |  |  | //  zero     : [0]uint8 | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | //  names    : ["" "" ""] | 
					
						
							|  |  |  | //  distances: [0 0 0 0 0] | 
					
						
							|  |  |  | //  data     : [0 0 0 0 0] | 
					
						
							|  |  |  | //  ratios   : [0.00] | 
					
						
							|  |  |  | //  alives   : [false false false false] | 
					
						
							|  |  |  | //  zero     : [] | 
					
						
							| 
									
										
										
										
											2018-11-13 17:43:25 +03:00
										 |  |  | // --------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							|  |  |  | } |