restructure: arrays and slices

This commit is contained in:
Inanc Gumus
2019-01-29 19:43:12 +03:00
parent 096ac9c251
commit c43d152d33
108 changed files with 92 additions and 243 deletions

View File

@ -0,0 +1,41 @@
package main
// ---------------------------------------------------------
// EXERCISE: Append #2
//
// 1. Create the following nil slices:
// + Pizza toppings
// + Departure times
// + Student graduation years
// + On/off states of lights in a room
//
// 2. Append them some elements (use your creativity!)
//
// 3. Print all the slices
//
//
// EXPECTED OUTPUT
// (Your output may change, mine is like so:)
//
// pizza : [pepperoni onions extra cheese]
//
// graduations : [1998 2005 2018]
//
// departures : [2019-01-28 15:09:31.294594 +0300 +03 m=+0.000325020
// 2019-01-29 15:09:31.294594 +0300 +03 m=+86400.000325020
// 2019-01-30 15:09:31.294594 +0300 +03 m=+172800.000325020]
//
// lights : [true false true]
//
//
// HINTS
// + For departure times, use the time.Time type. Check its documentation.
//
// now := time.Now() -> Gives you the current time
// now.Add(time.Hour*24) -> Gives you a time.Time 24 hours after `now`
//
// + For graduation years, you can use the int type
// ---------------------------------------------------------
func main() {
}