add: map exercises and quiz
This commit is contained in:
38
22-maps/exercises/01-warm-up/main.go
Normal file
38
22-maps/exercises/01-warm-up/main.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE: Warm-up
|
||||
//
|
||||
// Create and print the following maps.
|
||||
//
|
||||
// 1. Phone numbers by last name
|
||||
// 2. Product availability by Product ID
|
||||
// 3. Multiple phone numbers by last name
|
||||
// 4. Shopping basket by Customer ID
|
||||
//
|
||||
// Each item in the shopping basket has a Product ID and
|
||||
// quantity. Through the map, you can tell:
|
||||
// "Mr. X has bought Y bananas"
|
||||
//
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// Hint: Store phone numbers as text
|
||||
|
||||
// #1
|
||||
// Key : Last name
|
||||
// Element : Last name
|
||||
|
||||
// #2
|
||||
// Key : Product ID
|
||||
// Element : Available / Unavailable
|
||||
|
||||
// #3
|
||||
// Key : Last name
|
||||
// Element : Phone numbers
|
||||
|
||||
// #4
|
||||
// Key : Customer ID
|
||||
// Element Key:
|
||||
// Key: Product ID Element: Quantity
|
||||
}
|
||||
Reference in New Issue
Block a user