1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kruka [31]
3 years ago
10

The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c

ents. Write specifi cations for a function that computes the change, if any, that you should receive. Include a statement of purpose, the preconditions and postconditions, and a description of the arguments.
Mathematics
1 answer:
MrRa [10]3 years ago
8 0

Answer:

f(x,y) = \left \{ {(d-x,c-y) \, \, {y \, \leq c} \atop (d-x-1, 100+c-y) \, \, {y \, > \, c}} \right.

Where x is the amount of dollars the item costs and y is the amount of cents. The first entry of f(x,y) is the amount of dollars to be returned and the second entry is the amount of cents to be returned.

Step-by-step explanation:

let f(x,y) be the function that computes the change.

The parameter x is the amount of dollars it costs and y is the amount of cents. both x and y should be integers and both of them should be positive or 0. Also y must be lower than 100, and x cant be bigger than d. Also if x = d, then it must happen that y ≤ c. The return value f(x,y) is a pair (a,b) where a and b satisfies the same conditions than the ordered pair (x,y) (the change cant be higher than the amount paid). a represents the amount of dollars that has to be returned and b the amount of cents.

Now, lets go to the formula. The formula should depend on wether y is higher than d or not, if that is the case, then after substracting x from d, we need to substract one more and add 100 cents to c-y (because we cant be given negative cents)

f(x,y) = \left \{ {(d-x,c-y) \, \, {y \, \leq c} \atop (d-x-1, 100+c-y) \, \, {y \, > \, c}} \right.

You might be interested in
Combine like terms to simplify the expression:<br><br> 2/5k-3/5+1/10k
charle [14.2K]

Answer:

1/2k-3/5

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
On wednesday, Sam's bank account balance was -$55. On thursday his balance was less than that. Use absolute value to describe Sa
aliya0001 [1]
On Wednesday, his balance is -$55 this means that Sam had a debt of $55.
A day after, his balance was less than -$55. This means that Sam had a debt of MORE than $55. Notice that after applying absolute value, what was less than a negative number becomes greater when their absolute values are taken.
3 0
3 years ago
A dog jumps straight up in the air to catch a ball and lands on the ground 1.3 s later. Let h(t) represent the dog’s height, in
slamgirl [31]

The given question have mistake. The correct question is written below.

Question:

A dog jumps straight up in the air to catch a ball and lands on the ground 6.37 s later. Let h(t) represent the dog’s height, in meters, t seconds after he leaves the ground. Which equation models the dog’s height for a given time t?

Answer:

Option B:

h(t)=-4.9 t^{2}+6.37t

Solution:

<u>General formula for the height of the projectile over time:</u>

(1) h(t)=-16 t^{2}+v t+s

Where h = height in feet, t = time, v = initial velocity and s = initial height (feet)

(2) h(t)=-4.9 t^{2}+v t+s

Where h = height in meters, t = time, v = initial velocity and s = initial height(meter)

Given initial velocity = 6.37 s and initial height is 0.

The height of the dog is in meters.

So, use second formula and substitute v = 6.37 and s = 0.

h(t)=-4.9 t^{2}+v t+s

h(t)=-4.9 t^{2}+6.37t+0

h(t)=-4.9 t^{2}+6.37t

Hence option B is the correct answer.

6 0
3 years ago
So the question is "5(3x -5)" how do I know if the answer is 15x-25 or 15x+25?
nevsk [136]
Distribute. 

5(3x - 5)
5*3x - 5*5
15x - 25



4 0
3 years ago
Read 2 more answers
Given the following exponential function, identify whether the change represents growth or decay, and determine the percentage r
Whitepunk [10]

The change represents decay and the percentage decrease is 2.9%

<h3>Exponential function</h3>

The standard exponential function is expressed as y = ab^x

where:

a is the initial

b is the rate

If the value of b is less than 1 hence the function is decay and if greater than 1, the function is growth

GIven the expoenential function y=100(0.971)^x

Since the value of b = 0.971 < 1, hence the function is a decay.

The percentage decrease = 1 - 0.971 = 2.9%

Hence the percentage decrease is 2.9%

Learn more on exponential function here: brainly.com/question/12940982

5 0
3 years ago
Other questions:
  • The length of a rectangle is 3 inches longer then twice its width, where w is the width of the rectangle the area of the rectang
    7·1 answer
  • Maths answer quick!!
    6·1 answer
  • Laney is 4 feet 8 inches tall. There are 2.54 centimeters 8n 1 inch. What is laneys height in centimeters?
    7·1 answer
  • Write an equation m=5 through (-1,-3)
    15·1 answer
  • Answer all of these
    6·1 answer
  • Pls help will give brainlist
    7·1 answer
  • McKenna is filling a cube with bath salts to give to her friend. The cube measures 9 inches on all the edges. How many cubic inc
    13·2 answers
  • PLZ help thnx
    9·1 answer
  • The equation Y= -8x + 1,000
    12·2 answers
  • The expression (x^22) (x^7)^3 is equivalent to x^p what is the value of p?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!