ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 1 of 10 ITECH5403 - Assignment 2 – Parallel Implementations Due...

1 answer below »
kindly follow the requirements in attached file. there are 3 languages make sure you do in all three languages. programs are not big.



ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 1 of 10 ITECH5403 - Assignment 2 – Parallel Implementations Due Date: 5pm, Friday of Week 11 (Sem 1807) This assignment will test your skills in identifying comparative features of different programming languages through implementing a programming application. This task worth 20% marks of this course and belongs to the non-invigilated (type A) assessment task. Assignment Overview You are tasked with creating a text-based program for library admins to store data on a Library System. However, as this is a comparative languages course, you will be creating the same application in the following three programming languages: • Java, • Python, and • Lisp or Perl (you may choose either of these). As you implement the application in each language you should keep notes on: - The features of the languages used, - Which features you found useful, and - Any issues or complications which arose due to the complexity or lack of any language features. A brief discussion document based on these programming features for each individual language accompanying each implementation is required. Finally, a comparative overview of the languages highlighting how they were suitable or not suitable for the creating this type of application is also required. It is recommended that the first version of the application you write is in the programming language which is most familiar to you. This will help you to have a working 'template' which you can then translate into the other programming languages. Program Specification When the program first launches, there is a menu which allows the users (library admins) to select one of the following options: 1) Add new member 2) Add new book 3) Process borrowing 4) Process returning 5) View member status 6) View book status 7) Quit ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 2 of 10 The functionalities of these options are as follows: 1) When users add a new member they provide a member-name which are stored in some manner of array or list. Members are assigned a unique ID value where the first member added is assigned the ID value 1, the second member added is assigned the ID value 2 and so on. 2) When users add a new book they provide a book-title, and the number of copies of that book. These information are stored in some manner of array or list. Books are also automatically assigned a unique ID values such as 1, 2, 3 etc. Additionally, information needs to be kept regarding books whether they are available or not. 3) When users process a borrowing they provide a member-ID, and book-ID. The IDs must be registered on the system. That is, to successfully create a book borrowing: • The member ID must be of an existing member in the system • The book ID must be of a book that exists in the system, and • The book must be available to be borrowed After processing a borrowing, the information regarding the number of books should be updated. If no more copy of that book is available then the book is not available for borrowing. 4) When users process a returning, they provide a member-ID, and book-ID. The book should be taken off from that member’s record, and the number of available book information should be updated. 5) If the users opt to view member status then they are prompted to enter the member ID - and then any books borrowed by that member are displayed including: - The member’s name, and the title of books they are currently keeping. 6) If the users opt to view book status then they are prompted to enter a book ID - and then the following information are displayed: - number of available copy of the book, if it is zero then a message that the book is not available and - the list of members’ name who borrowed it. 7) When a user chooses to Quit, the program terminates with a goodbye message. Where required, your program should check for valid data entry and loop until valid data is entered. Each implementation of your project (in each of the three languages you choose) should aim to closely match the setup and structure of the program as shown in the example output on the following pages. Add codes to pre-create a few members, books and borrowings on each run of your code to avoid the need to type in those details over and over when testing your program. However your program should not depend only on those hard-coded items. Instead it should be capable of taking new items as inputs and give proper outputs according to those new inputs. These will be checked by the assessor at the time of marking your assignment. ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 3 of 10 Example Program Output Startup and add new member example output ----------------------------------------------- ----- Welcome to ITECH5403 Library System ----- ----------------------------------------------- Main Menu - please select an option: 1) Add new member 2) Add new book 3) Process borrowing 4) Process returning 5) View member status 6) View book status 7) Quit 1 Adding a new member: Please enter a new member name: Amina Member [Amina] has been created with member ID: [1] Would you like to [a]dd a new member or go-[b]ack to the previous menu? a Please enter a new member name: John Member [John] has been created with member ID: [2] Would you like to [a]dd a new member or go-[b]ack to the previous menu? a Please enter a new member name: Alex Member [Alex] has been created with member ID: [3] Would you like to [a]dd a new member or go-[b]ack to the previous menu? b Add new book example output Main Menu - please select an option: 1) Add new member 2) Add new book 3) Process borrowing 4) Process returning 5) View member status 6) View book status 7) Quit 2 Adding new book: Please enter a new book title: ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 4 of 10 Romeo et Juliette Book already exists: Book ID: 1 Book Title: Romeo et Juliette Number of copies: 1 Please enter a new book title: Sense and sensibility Please enter number of copies: 3 New book added: Book ID: 2 Book Title: Sense and sensibility Number of copies: 3 Would you like to [a]dd a new book or go-[b]ack to the previous menu? a Please enter a new book title: Prometheus Please enter number of copies: 2 New book added: Book ID: 3 Book Title: Prometheus Number of copies: 2 Would you like to [a]dd a new book or go-[b]ack to the previous menu? b Process borrowing example output Main Menu - please select an option: 1) Add new member 2) Add new book 3) Process borrowing 4) Process returning 5) View member status 6) View book status 7) Quit 3 Please enter a valid member ID: 99 Member does not exist. Please enter a valid member ID: 1 Please enter a valid book ID for borrowing by member [Amina]: 66 Book does not exist. Please enter a valid book ID for borrowing by member [Amina]: 3 *** Borrowing processed successfully*** Member: Amina Borrowed Book title: Prometheus Number of books remaining: 1 ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information Technology CRICOS Provider No. 00103D Page 5 of 10 Would you like to [p]rocess a new borrowing or go-[b]ack to the previous menu? p Please enter a valid member ID: 2 Please enter a valid book ID for borrowing by member [John]: 3 *** Borrowing processed successfully*** Member: John Borrowed Book title: Prometheus Number of books remaining: 0 Would you like to [p]rocess a new borrowing or go-[b]ack to the previous menu? p Please enter a valid member ID: 3 Please enter a valid book ID for borrowing by member [Alex]: 3 Sorry!!! Book titled [Prometheus] currently is not available for borrowing. Would you like to [p]rocess a new borrowing or go-[b]ack to the previous menu? p Please enter a valid member ID: 3 Please enter a valid book ID for borrowing by member [Alex]: 2 *** Borrowing processed successfully*** Member: Alex Borrowed Book title: Sense and sensibility Number of books remaining: 2 Would you like to [p]rocess a new borrowing or go-[b]ack to the previous menu? p Please enter a valid member ID: 3 Please enter a valid book ID for borrowing by member [Alex]: 1 *** Borrowing processed successfully*** Member: Alex Borrowed Book title: Romeo et Juliette Number of books remaining: 0 Would you like to [P]rocess a new borrowing or go-[b]ack to the previous menu? b Process returning example output Main Menu - please select an option: 1) Add new member 2) Add new book 3)
Answered Same DayMay 26, 2020ITECH5403

Answer To: ITECH5403 – Comparative Programming Languages School of Science, Engineering and Information...

Abr Writing answered on May 31 2020
150 Votes
print('-----------------------------------------------')
print('----- Welcome to ITECH5403 Library System -----')
print('-----------------------------------------------')
members, books
= list(), list()
class Member:
    def __init__(self, name):
        self.name = name
        self.ID = len(members)
        self.books_list = list()
    def borrow(self, book):
        self.books_list.append(book)
class Book:
    def __init__(self, book_ID, book_title, copies):
        self.book_ID = book_ID
        self.book_title = book_title
        self.copies = int(copies)
        self.borrowers_list = list()
    def borrower(self, member):
        self.borrowers_list.append(member)
def mainMenu():
    print('Main Menu - please select an option:')
    print('1) Add new member')
    print('2) Add new book')
    print('3) Process borrowing')
    print('4) Process returning')
    print('5) View member status')
    print('6) View book status')
    print('7) Quit')
    return input()
def bookExists(book_title):
    for book in books:
        if book.book_title == book_title:
            return True
    return False
def bookExistsID(book_ID):
    for book in books:
        if book.book_ID == int(book_ID):
            return True
    return False
def newBookAdded(book):
    print('New book added:')
    print('Book ID: {}'.format(book.book_ID))
    print('Book Title: {}'.format(book.book_title))
    print('Number of copies: {}'.format(book.copies))
def bookBorrowed(member_name, book):
    print('*** Borrowing processed successfully***')
    print('\t\tMember: {}'.format(member_name))
    print('\t\tBorrowed Book title: {}'.format(book.book_title))
    print('\t\tNumber of books remaining: {}'.format(book.copies))
def bookReturned(member_name, book):
    print('*** Returning processed successfully***')
    print('\t\tMember: {}'.format(member_name))
    print('\t\tBook returned: {}'.format(book.book_ID))
    print('\t\tAfter returning Number of books {} available in stock: {}'.format(book.book_title,...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here