Solve the Following problem and write it's code in Java Programming Language. Consider a personal checkbook management
Fantastic news! We've Found the answer you've been seeking!
Question:
Solve the Following problem and write it's code in Java Programming Language.
Transcribed Image Text:
Consider a personal checkbook management program like Quicken. It manages several bank accounts and investments and can handle your bill paying. Where could you use a Factory pattern in designing a program like that? We can start thinking that what could be our parent class. In above scenario we can consider CheckBook as parent class and let assume we have three type of check for this checkbook Travel, Health and Personal. These will be our child classes which have method to decide corresponding expenses or could be done with the help of Dependency Injection. We also need to create a CheckFactory class to implement Simple Factory Design Pattern. The UML diagram for this is shown in figure below. CheckBook CheckFactory +getExpense( ) decimal + chooseExpense( CheckBook Travel Health Personal getExpense( ) decimal getExpensel )decimal getExpense( )decimal Consider a personal checkbook management program like Quicken. It manages several bank accounts and investments and can handle your bill paying. Where could you use a Factory pattern in designing a program like that? We can start thinking that what could be our parent class. In above scenario we can consider CheckBook as parent class and let assume we have three type of check for this checkbook Travel, Health and Personal. These will be our child classes which have method to decide corresponding expenses or could be done with the help of Dependency Injection. We also need to create a CheckFactory class to implement Simple Factory Design Pattern. The UML diagram for this is shown in figure below. CheckBook CheckFactory +getExpense( ) decimal + chooseExpense( CheckBook Travel Health Personal getExpense( ) decimal getExpensel )decimal getExpense( )decimal
Expert Answer:
Answer rating: 100% (QA)
CheckFactoryjava import javautilScanner public class CheckFactory Scanner inputSomethingnew ScannerS... View the full answer
Posted Date:
Students also viewed these programming questions
-
In java programming language use the operations push, pop, peek, and empty to write operations that do each of the following: 1. set i to the second element from the top of the stack; leaving the...
-
Solve the following problem numerically from t = 0 to 3: dy/dx = - y + t2 y(0) = 1 Use the third-order RK method with a step size of 0.5.
-
Solve the following problem for x(t). * + 12x + 40x = 3 sin 5t x(0) = x (0) = 0
-
Imagine that you are a human resource manager in a domestically based company that has decided to operate internationally. You have been charged with sorting out the HRM effects of the decision. What...
-
Dane, Inc., reported cost of goods sold of $100,100 during the current year. Following are the beginning and ending balances of merchandise inventory and accounts payable for the year: Determine the...
-
A new sports car model has defective brakes 15% of the time and a defective steering mechanism 5% of the time. Lets assume (and hope) that these problems occur independently. If one or the other of...
-
Payne Oil Corporation, a successful efforts company, has capitalized costs on three leases as of 12/31/2013 as follows: Payne has no other capitalized costs. The leases are located in different...
-
Tyrell Co. entered into the following transactions involving short-term liabilities in 2015 and 2016. 2015 Apr. 20 Purchased $40,250 of merchandise on credit from Loco, terms n/30. Tyrell uses the...
-
6. The probability that Yuri will score a point on a free throw is 0.3. Yuri attempts two consecutive free throws. Part A What is the probability that he scores points on both free throws? Part B...
-
Cinder Inc. is a Canadian-controlled private corporation based in your province. The company operates a wholesale business. The following information is provided for its year ended May 31, 2020: 1....
-
Dowell Company produces a single product. Its income under variable costing for its first two years of operation follow. Variable Costing Income Income Year 1 $ 31,000 Year 2 $ 490,000 Additional...
-
The records of Bel Cold Refrigerator Company show the following information for the three months ended March 31, 2015. Materials purchased Rs. 1,946,700 Inventories, January 1, 2015: Finished goods...
-
Experience suggests that usage of surgical gloves at a hospital can be approximated by a Normal distribution with a standard deviation of one-half box of surgical gloves per day and a mean of five...
-
Luzent Company produces two types of entry doors: Deluxe and Standard. The assignment basis for support costs has been direct labor dollars. For 2015, Luzent compiled the following data for the two...
-
Alexon SL is an electronics business with eight product lines. Profit data for one of the products (XT-107) for the month just ended (June 2008) are as follows: Sales, 200 000 units at average price...
-
SF Co. operates on a calendar year basis . It begins the annual budgeting process in late August , when the president establishes target for total sales dollars and net operating income before taxes...
-
1040 PG 1 1040 PG 2 Schedule 1 Schedule 3 Form 1040 Page 1 and 2. Form 1040 (2020) Page 2 8814 4972 16 17 18 0 19 20 21 22 23 24 If you have 16 Tax (see instructions) Amount 17 Amount from Schedule...
-
For what reason might an exporter use standard international trade documentation (letter of credit, draft, order bill of lading) on an intrafirm export to its parent or sister subsidiary?
-
Hambleys Toy Store is on Regent Street in London. It has a magic department near the main door. Management is considering dropping the magic department, which has consistently shown an operating...
-
Ethos Day School is a private elementary school. In addition to regular classes, after-school care is provided between 3:00 p.m. and 6:00 p.m. at SF12 per child per hour. Financial results for the...
-
The Velasquez Company, a maker of a variety of metal and plastic products, is in the midst of a business downturn and is saddled with many idle facilities. The National Hospital Supply Company has...
Study smarter with the SolutionInn App