Create an interface MessageDecoder that has a single abstract method decode (cipherText), where cipherText is the message to be decoded. The method will return the decoded message. Modify the classes SubstitutionCipher and ShuffleCipher, as described in Exercises 16 and 17, so that they implement MessageDecoder as well as the interlace MessageEncoder that Exercise 15 describes. Finally, write a program that allows a user to encode and decode messages entered on the keyboard.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Degarmo's Materials And Processes In Manufacturing
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
SURVEY OF OPERATING SYSTEMS
Starting Out with Python (4th Edition)
- Your assignment for this course is to implement a beginner level Book Management System (BMS) in Java language. BMS contains 2 classes: Bookand BookList. The Book class has the following attributes: code: a String object, that hold the book’s code. title: a String object, that hold the book’s title. qua: int variable, that hold the number of books with the same code in the library. price: a double variable, that hold the book’s price. The BookList class contains only one data member: ArrayList<Book> t. When running the program display the menu as below:1. Input & add book(s) to the end.2. Display all books.3. Search a book for given code.4. Update the book’s price for given code.5. Find the (first) max price value.6. Sort the list ascendingly by code.7. Remove the book having given code.8. Load data from file.0. Exit.Notes:(1) The book’s code must be unique in the list.(2) Display all books in format (code, title, quantity, price).(5)…arrow_forwardWrite a program in java Design a class that holds the following personal data: name, address, age, and phone number.Write appropriate accessor and mutator methods. Demonstrate the class by writing aprogram that creates three instances of it. One instance should hold your information, andthe other two should hold your friends’ or family members’ information.arrow_forwardWrite a java program Create an Abstract class Student that contains a method take exam, implement the method in the child classes PhdStudent and GradStudent in which PhdStudent takes exam by giving his final defense presentation while the graduate student gives a written paper.arrow_forward
- Javaarrow_forwardImplement a superclass Person. Make two classes, Student and Instructor, that inherit from Person. A person has a name and a year of birth. A student has a major, and an instructor has a salary. Write the class declarations, the constructors, and the Supply a methods toString for all classes. test program for these classes and methods.arrow_forwardBelow we have class diagrams with three classes for a simple java based parking management class. Use the classes below to write java code for classes :a parking observer class (that implements an observer pattern) , a transaction manager class and a parking lot class(subject to the observer). Use the class diagram and java class to implement it. You should use an observer pattern to implement your code.The main goal is to implement the following - Once a car enters (in an entry-scan only lot) or leaves (in an entry-scan and exit-scan lot), then the ParkingObserver will be updated, and then can register the charge with the parking system via the TransactionManager’s park() methodarrow_forward
- Solve in Java only provide the Code to implement the constructor and the methods to implement the speaker interfacearrow_forwardUse java languagearrow_forwardInstructions: Write your answer on a piece of paper with your name on top. Take a picture and submit within the allocated time limit. Problem 1: Implement class Employee as illustrated below. Apply appropriate constructors, encapsulate, and override toString and equals. Student Course Problem 2: «interface Payable abstract Employee Person SalariedEmployee Idno Name Employee Superclass Department Salary Subclass getPayment Amount() firstName, lastName, SSN weeklysalary Given the class hierarchy: 1. Define the interface Payable. 2. Define the class Employee that implements Payable and encapsulate. 3. Define SalariedEmployee and encapsulate. Implement getPayment Amount(). getPayment Amount() - returns a double amount that must be paid for an object of any class that implements the interface. For SalariedEmployee, it would just return the value returned by getWeeklySalary(). for new files: 128MBarrow_forward
- Write a java programImagine a publishing company that markets both book and audiocassette versions of its work. Create a class publication that stores the title (a string) and price(type float) of a publication. From this class derive 2 classes: book, which adds a page count (type int); and tape, which adds a playing time in minutes (type float). Each of theses 3 classes should have a getdata() method to get its data from the user at the keyboard, and a putdata() function to display its data. Suppose you want to add the date of publication for both books and tapes. From the publication class, derive a new class called publication2 that includes this data member. Then change book and tape so ther are derived from publication2 instead of publication. Make all the necessary changes in member functions so the user can input and output dates along with the other data. For the dates, you can use the bulit-in date function which stores a date as 3 ints, for months, day and year. Write a…arrow_forwardWrite a Java enumeration LetterGrade that represents letter grades A through F, including plus and minus grades. Define a private instance vari- able to hold a boolean value that is true if the grade is passing. Also, define a constructor that initializes this instance variable, an accessor method is- Passing to return its value, and a method toString that returns the grade as a string. Finally, write a program to demonstrate the enumeration.arrow_forwardDesign ADT for a cave and a cave system. An archeologist should be able to add a newly discovered cave to a cave system and to connect two caves together by a tunnel. Duplicate caves—based on GPS coordinates—are not permitted. Archeologists should also be able to list the caves in a given cave system. Specify each ADT operation by stating its purpose, describing its parameters, and writing a pseudocode version of its header. Then Java interface for a cave's methods and one for the methods of a cave system. Include javadoc-style comments in your code. Java programarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education