-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestion 1 from lesson 25 April 2024.txt
123 lines (70 loc) · 2.68 KB
/
question 1 from lesson 25 April 2024.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
start
Declarations
choice
string titleBookOne = "The Great Gatsby"
num IDOne = 123456
string titleBookTwo = "Harry potter and the sorcerers stone"
string authorName = "JK.Rowling"
num IDTwo = 789012
output " Welcome to your online library "
output " Do u want to choose your book by title, authorName, ID number, book ID or do you want to exit the program ? "
if ( choice == exit)
else if (choice == title)
// Call BookDetails(titleBookOne, titleBookTwo)
BookDetails(titleBookOne, titleBookTwo)
else if ( choice == ID number )
//Call bookDetails(IDOne, IDTwo)
bookDetails(IDOne, IDTwo)
else if (choice == author name )
//Call bookDetails(authorName, titleBookTwo)
bookDetails(authorName, titlwBookTwo)
else if (choice == book ID)
//Call bookDetails(IDOne, IDTwo, authorName)
bookDetails(IDOne, IDTwo, authorName)
else
output " that is not a valid answer. Please enter one of the options or exit to end program. "
choice = ReadLine
stop
void BookDetails(titleBookOne, titleBookTwo)
output " which one do you want? "
choice = ReadLine
if (choice == Great Gatsby)
output " Great Gatsby "
else if (choice == Harry potter and the sorcerers stone)
output " Harry potter and the sorcerers stone "
else
output " no books like that is not in this library"
return
void bookDetails(IDOne, IDTwo)
output " enter the id number of the book"
choice = ReadLine
if (choice == 123456)
output " The Great Gatsby "
else if ( choice == 789012)
output " Harry potter and the sorcerers stone "
else
output " that book is not in this online library "
return
bookDetails(authorName, titlwBookTwo)
output " enter the authorName or title of the book "
choice =
if (choice == JK Rowling)
output " Harry Potter and the sorcerers stone "
else if (choice == Harry Potter and the sorcerers stone )
output " Harry Potter and the sorcerers stone written by JK Rowling "
else
output " that book or author is not found in this library "
return
void bookDetails(IDOne, IDTwo, authorName)
output " by ID there are 2 books "
output " enter the ID number or authorName "
choice = ReadLine
if ( choice == 123456 )
output " The Great Gatsby "
else if ( choice == 789012)
output " Harry potter and the sorcerers stone "
else if ( choice == JK Rowling )
output " Harry Potter and the sorcerers stone "
else
output " that book is not in this online library "
return