Examlex
Programming (15 points)
In this question, we'll address the following problem: Can a cash register containing a given amount of pennies (1-cent coins) and a given amount of nickels (5-cent coins) give a customer a given exact amount of cents of change? For example, if there are 3 pennies and 5 nickels in the cash register, is it possible to give exactly 19 cents of change? (No.) If there are 2 pennies and 7 nickels in the register, is it possible to give exactly 26 cents of change? (Yes.)
Write a static method named canMakeChange that accepts three integer parameters representing the number of pennies in the cash register, the number of nickels in the cash register, and the desired amount of change to make. The method should return true if the coins in the register can produce this exact amount of change, and false if not. The coins in the register must be able to exactly produce the desired amount of change in order to return true; for example, if the register contains 0 pennies and 100 nickels, it is not able to exactly produce 8 cents of change.
The following are several sample calls to your method and the values they should return. You may assume that no negative parameter values are passed, but otherwise your method should work with any values passed.
Undervalued Inventory
Inventory that is reported at a value lower than its actual market value, potentially affecting financial statements and tax liabilities.
Cost Method
An accounting method used to value an investment, based on the cost to acquire it, without considering its fair market value changes.
Voting Shares
Shares that grant the holder the right to vote on corporate matters, typically related to company governance.
Bonds Payable
Long-term liabilities on a company's balance sheet, representing the amount owed to bondholders by the issuer.
Q3: What are the four geographic areas of
Q9: Which religion's centers were in the northeast,
Q14: Inputs, or factors of production, include<br>A)labor.<br>B)machinery.<br>C)natural resources.<br>D)all
Q19: To emphasize the abstract nature of his
Q24: What is characterized by subtle transitions between
Q29: Critic Lawrence Alloway may have named Pop
Q33: According to Robert Reich, secretary of Labor
Q75: How is a production indifference map helpful?
Q113: If California were a separate economy, it
Q215: For the typical student, taking an introductory