-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPart 1 Method Overloading .txt
56 lines (46 loc) · 1.37 KB
/
Part 1 Method Overloading .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
learning unit 4 theme 2
start
//Declarations of variables
string choice
string booksTitleOne = "The Great Gatsby"
string booksTitleTwo = "Harry Potter and the Sarcerer's Stone"
num bookIdOne = 123456
num bookIdTwo = 789012
string authorsNameOne = "J.K Rowling"
string authorsNameTwo = "George Orwell"
//open the program
output "Welcome to the Library"
//Prompt User to choose the book they want details on
output "What you wish to retrieve from the Book Details"
output A = Title
output B = Identification
output C = Author and the Title
output D = Identification and the Author
input choice
if (choice == A)
bookDetails(booksTitleOne)
else if (choice == B)
bookDetails(bookIdOne)
else if (choice == C)
bookDetails(authorsNameOne, booksTitleTwo)
else (choice == D)
bookDetails(bookIdTwo, authorsNameTwo)
stop
void bookDetails(booksTitleOne)
ouput "The title of the book is:"
output booksTitleOne
return
void bookDetails(bookIdOne)
ouput "The ID of the book is:"
output bookIdOne
return
void bookDetails(authorsNameOne, booksTitleTwo)
ouput "The Author and the title of the book is:"
output authorsNameOne
output booksTitleTwo
return
void bookDetails(bookIdTwo, authorsNameTwo)
ouput "The ID and the Author of the book is:"
output bookIdTwo
output authorsNameTwo
return