forked from steger/pr3-sose2026
fixed some comment & a little refactoring
parent
6af376c1c4
commit
cff08c274c
|
|
@ -17,7 +17,7 @@ type Product struct {
|
|||
price float32
|
||||
}
|
||||
|
||||
var initial_inventory = [1]Product{{ELECTRONICS, "Laptop", 10, 100.0}} //Subtask 2 => Did you mean "product(s)" instead of "product names"
|
||||
var initial_inventory = [1]Product{{ELECTRONICS, "Laptop", 10, 100.0}} //Subtask 2 => Did you mean "product(s)" instead of "product names"?
|
||||
var inventory = initial_inventory[0:] //Subtask 3
|
||||
|
||||
var product_categories = map[prod_category]string{
|
||||
|
|
@ -53,8 +53,8 @@ func DisplayInventory() {
|
|||
fmt.Println("Kategorie: |Name: |Preis: |Menge: |")
|
||||
|
||||
for i := 0; i < len(inventory); i++ {
|
||||
product := inventory[i]
|
||||
fmt.Printf("%s | %s | %.2f | %.2f |\n", product_categories[product.category], product.name, product.price, product.quantitiy)
|
||||
|
||||
fmt.Printf("%s | %s | %.2f | %.2f |\n", product_categories[inventory[i].category], inventory[i].name, inventory[i].price, inventory[i].quantitiy)
|
||||
}
|
||||
fmt.Println()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue