Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Contract class represents a contract. The contract will have an identifying number, a minimum and a maximum value (sets the range of what the

image text in transcribed

The Contract class represents a contract. The contract will have an identifying number, a minimum and a maximum value (sets the range of what the contractor gets paid upon completion), a deadline (when the contract needs to be completed), a possible bonus and penalty paid if the contractor completes early or late, an indicator for whether the contract is accepting bids, what the best bid is so far, and an indicator of whether the contract has been completed. The Contract class should have the following methods: a. getID Takes no input and returns a string. Gets the ID of the contract Takes no input and returns a double. Gets the minimum value of the contract. Takes a double as input and returns nothing. Sets the minimum value for the contract. Takes no input and returns a double. Gets the maximum value of the contract Takes a double as input and returns nothing. Sets the maximum value for the contract. Takes no input and returns a double. Gets the per-day bonus associated with the contract. Takes a double as input and returns nothing. Sets the per-day bonus associated with the contract b. getMinValue d. getMaxvalue f. getbonus g. aetBonua h. getPenalty Takes no input and returns a double. Gets the per-day penalty associated with the contract setPenalty Takes a double as input and returns nothing. Sets the per-day penalty associated with the contract. j. getDeadline Takes no input and returns a Date. Gets the deadline for the contract Takes a Date as input and returns nothing. Sets the deadline for the contract you are to override the equals method inherited from object so that this Contract is equal to the input object if that object is a contract with the same ID as this contract. Takes no input and returns a boolean. Returns true if a contractor may submit a bid for the contract. Takes no input and returns a Bid. Returns the best bid so far for the contract. May return null if there have been no acceptable bids. k.setDeadline l. equals m. iBAcceptingBida n. getBestBid O. makeBid Takes a Bid as input and returns a boolean. Processes a bid. The method returns true if this bid is accepted and becomes the current best bid. The method returns false if the bid is not accepted. For a bid to be accepted, the contract must be accepting bids and the bid's contract must equal this contract. Also, the value of the bid must be between (or equal to) the minimum and maximum value for the contract, and the value must be smaller than the current best bid (if there exists a current best bid) p. awardContract q. isComplete f. completeDate s. setcomplete Takes a Date as input and returns nothing. Sets the contract to completed, sets the completed date for the contract to the input value, and pays the contractor of the best bid the required amount by Takes no input and returns nothing The contract is no longer accepting bids Takes no input and returns a boolean. Returns true or false depending on whether the contract has been completed Takes no input and returns a Date. Returns the date that the contract was completed. Will return null if the contract was not completed calling the pay method of the appropriate Contractor instance. The amount paid should be equal to the value of the best bid plus or minus any bonus or penalty. The bonus and penalty is computed by multiplying the contract bonus or penalty amount by the number of days the contract is completed before or after the deadline. However, the amount paid should not exceed the maximum value of the contract nor should the amount paid be negative (though it can otherwise be smaller than the minimum value of the contract) The Contract class should have the following constructor: a. The constructor takes a contract id, a minimum value, a maximim value, a bonus amount, a penalty amount, and a deadline and initializes the Contract instances appropriately

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions