A library gives each book a code made from the first three letters of the book title in upper case, followed by the last two digits of the year the book was published - OCR - GCSE Computer Science - Question 4 - 2018 - Paper 1
Question 4
A library gives each book a code made from the first three letters of the book title in upper case, followed by the last two digits of the year the book was publishe... show full transcript
Worked Solution & Example Answer:A library gives each book a code made from the first three letters of the book title in upper case, followed by the last two digits of the year the book was published - OCR - GCSE Computer Science - Question 4 - 2018 - Paper 1
Step 1
Complete the following pseudocode for a function definition that will take in the book title and year as parameters and return the book code.
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Use pseudocode to write an algorithm that does the following : Inputs the title and year of a book from the user.
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
start
// Input title and year from user
output "Enter title:"
input title
output "Enter year:"
input year
// Use the librarycode function to get the book code
code = librarycode(title, year)
// Permanently store the new book code to the file 'bookcodes.txt'
open file "bookcodes.txt" for appending
write code to file
close file
end