-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtask3.txt
66 lines (53 loc) · 1.4 KB
/
task3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Stage 3/6: User menu
Description
Let's modify the previously written search program an add a user menu for a better user experience.
Objectives
In this stage, you need to create a menu. The menu should display the following options:
1. Search information.
2. Print all data.
0. Exit.
The user must select a menu item and then enter data if necessary. Your program must not stop until the corresponding option (the exit option) is chosen.
Decompose the program into separate methods to make it easy to understand and to further develop or edit.
Example
In the example below, we use people as a dataset example. The lines that start with > represent the user input. Note that these symbols are not part of the input.
Enter the number of people:
> 6
Enter all people:
> Dwight Joseph [email protected]
> Rene Webb [email protected]
> Katie Jacobs
> Erick Harrington [email protected]
> Myrtle Medina
> Erick Burgess
=== Menu ===
1. Find a person
2. Print all people
0. Exit
> 3
Incorrect option! Try again.
=== Menu ===
1. Find a person
2. Print all people
0. Exit
> 1
Enter a name or email to search all suitable people.
> KATIE
Katie Jacobs
=== Menu ===
1. Find a person
2. Print all people
0. Exit
> 2
=== List of people ===
Dwight Joseph [email protected]
Rene Webb [email protected]
Katie Jacobs
Erick Harrington [email protected]
Myrtle Medina
Erick Burgess
=== Menu ===
1. Find a person
2. Print all people
0. Exit
> 0
Bye!