![]() |
.. (לתיקייה המכילה) | |
How do I write code, compile and run Go applications? | |
Writing Go code can be done with any text editor. In order to compile you may use the computers in the SSDL lab. On the Linux server and Linux computers you may find Go compiler and linker. So what you do is: 1. Write your code. Save it to a file named q2.go 2. Use the compiler located at: /usr/local/go/bin/6g /usr/local/go/bin/6g q2.go (if your file is in another folder add correct path to your file) a new file named q2.6 is created 3. Use the linker located at: /usr/local/go/bin/6l /usr/local/go/bin/6l q2.6 a new file named 6.out is created run 6.out You can also install the compiler on your Linux machine (if you got one). A Windows compiler is not fully implemented thus I wouldn't advice using it (although it might do the job). |
How do I read a character in Go? | |
See a simple program that reads a character from the user and prints its ASCII value: package main import "fmt" func main() { var ch byte fmt.Scanf("%c", &ch) fmt.Println(ch) } |
Can we assume that the number of repetitions is bounded? | |
Yes you can. You can assume that number of repetitions (of each letter) can fit into an 16 bit Integer in Pascal and int32 in Go. |
Q1, Q2: Please define what is a legal user's input | |
The user may input any sequence of characters composed of the characters: a-z A-Z 0-9 ~!@#$%^&*)(_+ You don't need to check that the input is legal. You may assume it is. The sequence is terminated with: Pascal: EOF (as the given example) Go: enter (will be easier for you to implement) |
Part2 Q6: What is a programming language? | |
"A programming language is a notation for writing programs, which are specifications of a computation or algorithm" In the following link you can find a full definition for a programming language: http://en.wikipedia.org/wiki/Programming_language |
Changes in part two | |
Q2 assumption added Q8 explain why JavaScript is autarkic (holistic was removed). Q10 is canceled |
Were can I find info about Java's keywords? | |
Just search it on the web. |
What if we print the values in a sorted manner but didn't actually sort the data structure? | |
No it is not. You need to sort the data structure. |
What is an autarkic language? | |
Autarkic language is a language in which the program determines it's limits. Meaning, by looking at the program and the language definition one can know: - What's included in the program - What's not included in the program - The meaning of the program - The starting point e.g. C is not autarkic To make things simpler, assume that the program include all the files that are included using the language's inclusion mechanism. |