├── LICENSE ├── README.md ├── project 1.go └── project 2.go /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Shreya Christiana 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # golang -------------------------------------------------------------------------------- /project 1.go: -------------------------------------------------------------------------------- 1 | // Debug & Fix 2 | 3 | 4 | // Your colleague tried to make a program that is intended to output "GO" three times on separate lines. 5 | // However, he is still new to Go and has made a number of mistakes in the code. 6 | 7 | // Debug and fix the code to produce the desired output. 8 | 9 | //debugged code 10 | 11 | package main 12 | import "fmt" 13 | 14 | func main() { 15 | // outputs GO 3 times 16 | fmt.Println("GO") 17 | fmt.Println("GO") 18 | fmt.Println("GO") 19 | } 20 | -------------------------------------------------------------------------------- /project 2.go: -------------------------------------------------------------------------------- 1 | // You are making a robot that can speak numbers. 2 | // Your robot should take 3 numbers in the range of 0-10 as input and output the corresponding texts in English 3 | 4 | // Sample Input: 5 | // 8 6 | // 0 7 | // 5 8 | 9 | // Sample Output: 10 | // Eight 11 | // Zero 12 | // Five 13 | 14 | //say the numbers 15 | 16 | 17 | package main 18 | import "fmt" 19 | 20 | func main() { 21 | //your code goes here 22 | for i := 1; i<=3; i++{ 23 | 24 | var i int 25 | fmt.Scanln(&i) 26 | 27 | 28 | switch i { 29 | case 0: 30 | fmt.Println("Zero") 31 | case 1: 32 | fmt.Println("One") 33 | case 2: 34 | fmt.Println("Two") 35 | case 3: 36 | fmt.Println("Three") 37 | case 4: 38 | fmt.Println("Four") 39 | case 5: 40 | fmt.Println("Five") 41 | case 6: 42 | fmt.Println("Six") 43 | case 7: 44 | fmt.Println("Seven") 45 | case 8: 46 | fmt.Println("Eight") 47 | case 9: 48 | fmt.Println("Nine") 49 | case 10: 50 | fmt.Println("Ten") 51 | default: 52 | fmt.Println(i) 53 | } 54 | } 55 | } 56 | --------------------------------------------------------------------------------