Question: Write a class named PayLogger that logs payments, according to the following public interface. PayLogger() void logPayment(double amt) double smallesto) constructs a PayLogger object process

 Write a class named PayLogger that logs payments, according to the

Write a class named PayLogger that logs payments, according to the following public interface. PayLogger() void logPayment(double amt) double smallesto) constructs a PayLogger object process the specified payment amount (>0) returns the smallest payment processed, or if no payments have been logged yet. returns the average payment, in dollars, or O if no payments have been logged yet return the total dollar amount of payments logged double average) double getTotali) Implement precondition testing, throwing exceptions where appropriate. No comments or class constants required. Here is sample client code: PayLogger pl = new PayLogger(); pl.logPayment(30); pl.logPayment(20); pl.logPayment(100); There were 3 payments logged for a total of $150. The smallest is $20 and the average is $50. Remember to use Preformatted

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!