본문 바로가기

[JAVA] 개발

(14)
Java Software Solution Ch7_PP2 PP 7.2 Create a class called SalesPerson that represents a salesperson in an organization. The SalesPerson class should have the name, the phone number, and the assigned district of a salesperson. Each salesperson acquires a certain sale amount every day. Provide a constructor that sets all instance values based on parameter values. Overload the constructor such that each daily sale amount for a..
Java Software Soution Ch7_PP8 PP 7.8 Write a Java interface called Lockable that includes the following methods: setKey, lock, unlock, and locked. The setKey, lock, and unlock methods take an integer parameter that represents the key. The setKey method establishes the key. The lock and unlock methods lock and unlock the object, but only if the key passed in is correct. The locked method returns a boolean that indicates wheth..
Java Software Solution Ch11_PP3 ; Exception Class PP 11.3 Suppose in a particular business all documents are given a twocharacter designation starting with either U, C, or P, standing for unclassified, confidential, or proprietary. Create an exception class called InvalidDocumentCodeException, designed to be thrown when an improper designation for a document is encountered during processing. If a document designation is encountered that doesn’t..
Java Software Solution Ch11_ PP1 ; Exception Class (try-catch) PP 11.1 Write a program that creates an exception class called StringTooLongException, designed to be thrown when a string is discovered that has too many characters in it. In the main driver of the program, read strings from the user until the user enters "DONE". If a string is entered that has too many characters (say 20), throw the exception. Allow the thrown exception to terminate the progra..
Java Software Solution Ch10_PP3 ; Interface PP 10.3 Implement the Speaker interface described in Section 10.3, and create three classes that implement Speaker in various ways. Create a driver class whose main method instantiates some of these objects and tests their abilities. Speaker.interfacepublic interface Speaker { public void speak(); public void announce(String str);} Singer.javapublic class Singer implements Speaker{ public void s..
Java Software Solution Ch7_PP8 ; Interface, Class, toString() 책 Java Software Solution 9th Edition 의 문제 Chapter7 PP8 Write a Java interface called Lockable that includes the following methods: setKey, lock, unlock, and locked. The setKey, lock, and unlock methods take an integer parameter that represents the key. The setKey method establishes the key. The lock and unlock methods lock and unlock the object, but only if the key passed in is correct. The lock..