| 
									
										
										
										
											2018-10-13 23:30:21 +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/ | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // --------------------------------------------------------- | 
					
						
							| 
									
										
										
										
											2018-11-06 10:13:24 +03:00
										 |  |  | // EXERCISE: Find the Rectangle's Perimeter | 
					
						
							| 
									
										
										
										
											2018-10-22 22:44:36 +03:00
										 |  |  | // | 
					
						
							| 
									
										
										
										
											2018-11-06 10:13:24 +03:00
										 |  |  | //  1. Find the perimeter of a rectangle | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | //     Its width is  5 | 
					
						
							|  |  |  | //     Its height is 6 | 
					
						
							|  |  |  | // | 
					
						
							| 
									
										
										
										
											2018-11-06 10:13:24 +03:00
										 |  |  | //  2. Assign the result to the `perimeter` variable | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | // | 
					
						
							| 
									
										
										
										
											2018-11-06 10:13:24 +03:00
										 |  |  | //  3. Print the `perimeter` variable | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | // | 
					
						
							|  |  |  | // HINT | 
					
						
							| 
									
										
										
										
											2018-11-13 16:51:04 +03:00
										 |  |  | //  Formula = 2 times the width and height | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | // | 
					
						
							|  |  |  | // EXPECTED OUTPUT | 
					
						
							|  |  |  | //  22 | 
					
						
							| 
									
										
										
										
											2018-11-13 16:51:04 +03:00
										 |  |  | // | 
					
						
							|  |  |  | // BONUS | 
					
						
							|  |  |  | //  Find more formulas here and calculate them in new programs | 
					
						
							|  |  |  | //  https://www.mathsisfun.com/area.html | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | // --------------------------------------------------------- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							| 
									
										
										
										
											2018-10-22 22:47:16 +03:00
										 |  |  | 	// UNCOMMENT THE CODE BELOW: | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// var ( | 
					
						
							| 
									
										
										
										
											2018-11-06 10:13:24 +03:00
										 |  |  | 	// 	perimeter        int | 
					
						
							| 
									
										
										
										
											2018-10-13 23:30:21 +03:00
										 |  |  | 	// 	width, height = 5, 6 | 
					
						
							|  |  |  | 	// ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// USE THE VARIABLES ABOVE WHEN CALCULATING YOUR RESULT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// ADD YOUR CODE BELOW | 
					
						
							|  |  |  | } |