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
laila [671]
3 years ago
6

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 specifications 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.
Computers and Technology
1 answer:
RSB [31]3 years ago
7 0

Answer:

Get the actual price of the item and convert it to cents, also get and convert the amount paid to cents.

subtract the actual price of the item from the paid amount ( which is in cents), if the result is greater than zero, covert the result back to dollars and output the result.

Explanation:

The program converts the actual price of the item and the amount paid to cents (where a dollar is equal to 100 cents). The variables are subtracted to get the change to be refunded, the result is converted back to dollars as the actual change to be paid.

You might be interested in
Write a print statement that displays a random integer between 5 and 5000. Assume the random library is imported.
Contact [7]

Answer:

Explanation:

The following code is written in Java. It is a very simple three line statement (assuming that the random library was imported) that chooses a random integer value between 5 and 5000 and prints it to the screen using the println statement.

Random rand = new Random();

int randomNum = rand.nextInt((5000 - 5) + 1) + 5;

System.out.println(randomNum);

The random number generator is initialized and given a value between 5 and 5000. Since random number Generator will generate a number between 0 and the given value then subtracting 5 from the initial generated number makes sure that it is not more than 5000 and then adding 1 and 5 after wards makes sure that it is more than 5 always.

4 0
3 years ago
All information is clearly identified and easy to find within the source
faust18 [17]

Answer:

reliable or credible

A document if it is clearly identified as well as it is quite easy to find it with the source, is said to be credible and reliable. If you want to find more then you can study the library Science and information science.

Its an important part of Library Science, as well as information science.

Explanation:

A document can be reliable only if it provides the correct answer, and can be found easily. If this is not the case then that document cannot be considered as being reliable or credible. This is the first thing which should be kept in mind while collecting the documents.

6 0
4 years ago
Give your definition of a stored procedure. Based on the Academic Database, identify and describe a scenario where it would be n
Tems11 [23]

, identify and describe a scenario where it would be

8 0
3 years ago
Only now _______ why you didn't tell me.​
katrin [286]

Answer:

I understand

Explanation:

6 0
3 years ago
Read 2 more answers
16
Lubov Fominskaja [6]
16
is a built-in mathematical formula included in MS Excel,
A) Function
4 0
3 years ago
Other questions:
  • Describe how data center storage applications drive the development of SAN technology.
    8·1 answer
  • When does kernel panic occur?
    14·1 answer
  • Mai has recently created her own e-mail account. Her father gave her permission to e-mail her friends and family but warned her
    11·2 answers
  • When specifying keywords to conduct an internet search, which of the following parts of speech will be the most useful??
    6·1 answer
  • True or False: A function with no parameters or extern vars can only return a
    8·1 answer
  • java Two smallest numbers Write a program that reads a list of integers, and outputs the two smallest integers in the list, in a
    6·1 answer
  • 10<br> Which of the following is not one of the most popular Spreadsheet software applications?
    6·1 answer
  • A Development team begins work on a new software application and decides to involve the client’s IT experts to ensure that secur
    12·1 answer
  • Multiple Choice: Circle the letter that corresponds to the correct answer.
    12·1 answer
  • Select all steps in the list below that should be completed when using the problem-solving process discussed in this chapter.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!