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.
Malapropism
The mistaken use of a word in place of a similar-sounding one, often with unintentionally amusing effect.
Static Evaluation
Pronouncement that does not take the possibility of change into consideration.
Jargon
Specialized language used by a particular profession or group.
Bypassing
A communication barrier where the same words or phrases are interpreted differently by different people, leading to misunderstandings.
Q1: While Loop Simulation<br>For each call below
Q1: What kind of ceramic style did Pueblo
Q6: Expressions<br>For each expression in the left-hand
Q16: Which Renaissance culture influenced Manet's Luncheon on
Q27: According to art historians, Artemisia Gentileschi frequently
Q33: According to Robert Reich, secretary of Labor
Q33: An economic model can be defined as<br>A)a
Q41: A model that is an oversimplification for
Q82: Abstraction is used in economics to omit
Q169: Economics<br>A)is a narrowly focused discipline.<br>B)is a broad-ranging