Problem

FilteredAccount. A cash processing company has a class called Account used to process tran...

FilteredAccount. A cash processing company has a class called Account used to process transactions:

public Account(Client c)

Constructs an account using client information

public boolean process(Transaction t)

Processes the next transaction, returning true if the transaction was approved and false otherwise

Account objects interact with Transaction objects, which have many methods including

public int value ( )

Returns the value of this transaction in pennies (could be negative, positive or zero)

Design a new class called FilteredAccount whose instances can be used in place of normal accounts but which include the extra behavior of not processing transactions with a value of 0. More specifically, the new class should indicate that a zero-valued transaction was approved but shouldn’t call the process method for it. Your class should have a single constructor that accepts a parameter of type Client, and it should include the following method:

public double percentFiltered ( )

Returns the percent of transactions filtered out (between 0.0 and 100.0); returns 0.0 if no transactions are submitted

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 9
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT