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
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Starting Out with C++: Early Objects
Modern Database Management
Starting Out with Java: Early Objects (6th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Starting Out with Python (3rd 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
- This way, any class that implements the Visible interface can define its own behavior for making an object visible or invisible based on its specific requirements.Create the Priority Java interface, which has the methods setPriority and getPriority. A method for determining numerical priority among a group of objects should be defined by the interface. Create and implement a class named Task that represents a task that implements the Priority interface, such as one that is on a to-do list. To test some Task objects, construct a driver class.arrow_forwardSolve in Java only provide the Code to implement the constructor and the methods to implement the speaker interfacearrow_forwardUse java languagearrow_forward
- Instructions: 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_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