Skip to content

Commit

Permalink
add instrucitons and update slice.go
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangbits committed Jun 2, 2020
1 parent a1df609 commit 3c12dc2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Binary file added c1-m1-getting-started/capture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions c1-m2-activity/instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## trunc íntructions

Write a program which prompts the user to enter a floating point number and prints the integer which is a truncated version of the floating point number that was entered. Truncation is the process of removing the digits to the right of the decimal place.

Submit your source code for the program, “trunc.go”

## fidian ins

Write a program which prompts the user to enter a string. The program searches through the entered string for the characters ‘i’, ‘a’, and ‘n’. The program should print “Found!” if the entered string starts with the character ‘i’, ends with the character ‘n’, and contains the character ‘a’. The program should print “Not Found!” otherwise. The program should not be case-sensitive, so it does not matter if the characters are upper-case or lower-case.

Examples: The program should print “Found!” for the following example entered strings, “ian”, “Ian”, “iuiygaygn”, “I d skd a efju N”. The program should print “Not Found!” for the following strings, “ihhhhhn”, “ina”, “xian”.

Submit your source code for the program, “findian.go”.
5 changes: 5 additions & 0 deletions c1-m3-activity/ins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Instructions

Write a program which prompts the user to enter integers and stores the integers in a sorted slice. The program should be written as a loop. Before entering the loop, the program should create an empty integer slice of size (length) 3. During each pass through the loop, the program prompts the user to enter an integer to be added to the slice. The program adds the integer to the slice, sorts the slice, and prints the contents of the slice in sorted order. The slice must grow in size to accommodate any number of integers which the user decides to enter. The program should only quit (exiting the loop) when the user enters the character ‘X’ instead of an integer.

Submit your source code for the program, “slice.go”.
2 changes: 1 addition & 1 deletion c1-m3-activity/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func main() {
sli := make([]int, 0, 3)
var sli []int
for {
var inputValue rune
fmt.Println("Please enter an integer: ")
Expand Down

0 comments on commit 3c12dc2

Please sign in to comment.