Updated: May 27
Welcome to the second assignment of this Go Tutorial series.
Objectives of the assignment:
To revise the concepts studied till now.
To have a clear understanding of the theory.
Writing a working Go code.
Use proper comments while writing your code.
Use sensible variable names.
Try to use the concepts studied wherever applicable.
Try to take inputs from the system and not hardcode it.
Always check for corner cases. Your code should run properly for any input.
How do you evaluate your assignment?
Your code should compile without any error.
Test your code for the test case provided in the problems.
If you want a detailed analysis of your solution(code review included), please mail your solution to email@example.com with the following details:
Subject: Go Assignment -2 Solution
Body: Write your name and your place of residence.
Attachment: Please make sure that you send a single attachment in a zip folder titled Go_Assignment_2.zip. Place all the solutions in the folder.
Write a program to find the maximum number in an integer array. Test cases: a. Input: [7,0,1,9,4,3] Output: 9
Write a program to transpose a given 2D array. A transpose of an array is when you swap rows and columns. Test cases: a. Input: 1 2 5 5 7 0 9 2 1 Output: 1 5 9 2 7 2 5 0 1
Write a program to sort an integer array in ascending order. Test cases: a. Input: [9,3,1,8,7] Output: [1,3,7,8,9]
Write a program to find a pair with a given sum in it. Test cases: a. Input: Array -> [8,7,2,5,3,1] Sum -> 10 Output: (0,2) or (1,4). Anyone would do.
Please Note: Do not be disheartened if you are not able to solve any problem. We are all here to learn. Send me the best you can do, just do not cheat yourself. If you send me your best work, I could analyse that and come up with its feedback that will help you in the future. If you have any doubts regarding any question, write a mail to me with the subject: Clarification on Assignment-2 and write the problem you have in the mail body.
Looking forward to your solution.