11-Command-Line-Game-Store-Project-Query-By-Id

command
v0.0.0-...-228c668 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Add a new command: "id". So the users can query the games by id.

1. Before the loop, index the games by id (use a map).

  1. Add the "id" command. When a user types: id 2 It should print only the game with id: 2.

3. Handle the errors:

id
wrong id

id HEY
wrong id

id 10
sorry. i don't have the game

id 1
#1: "god of war" (action adventure) $50

id 2
#2: "x-com 2" (strategy) $40

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL