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
What is the name of the symbol that is used to classify and categorize information?​
igomit [66]

Answer:

A Hashtag

Explanation:

3 0
3 years ago
Read 2 more answers
The______for our newest game keeps changing as we develop our concept and refine our goals.
antiseptic1488 [7]
I think d is the best here
6 0
3 years ago
Read 2 more answers
Describe at least one issue of terrorism that has happened recently.
zvonat [6]

Answer:

The republicans storming the capitol

Explanation:

6 0
2 years ago
How are < embed > tags used in web page creation?
yKpoI14uk [10]

Answer:

The <embed> HTML element embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in.

Explanation:

7 0
2 years ago
There are two String variables, s1 and s2, that have already been declared and initialized. Write some code that exchanges their
Ivan

Answer:

//here is code in java.

import java.util.*;

class Solution

{

// main method of class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // declare an initialize first string variables

     String st1="hello";

     // declare an initialize first string variables

     String st2="world";

     // create another string variable

    String st3;

    // exchange the value of both string variables

    st3=st1;

    st1=st2;

    st2=st3;

    System.out.println("value of first String after exchange: "+st1);

    System.out.println("value of second String after exchange: "+st2);

   }catch(Exception ex){

       return;}

}

}

Explanation:

declare and initialize two string variables.Create another string variable "st3". first assign value of "st1" to "st3" after then value of "st2" to "st1" and then  assign value of "st3" to "st2". This will exchange the values of both the string.

Output:

value of first String after exchange: world

value of second String after exchange: hello

8 0
3 years ago
Read 2 more answers
Other questions:
  • helppppp asap!!!!!!!!!! Sara has just started using the Internet. She would like to be a little more efficient. In 3–4 sentences
    9·2 answers
  • What file may contain data written to it in case of an unexpected error or program shut-down?
    5·1 answer
  • In what scenario should dhcp servers also be active dhcp clients?
    8·1 answer
  • If you want to track users and sessions across multiple domains, what must you set up?
    11·1 answer
  • The ash and dust from a volcanic eruption can cause a _______ change in the environment.
    13·1 answer
  • Which of the following are not parts of a message? Select all that apply.
    12·1 answer
  • Which of the following is a default letter assigned for the primary hard drive
    6·2 answers
  • Unlike radio frequency identification (RFID) tags, bar codes: Question 30 options: require a reader that tunes into a specific f
    14·1 answer
  • All _______ that store more than one piece of data ​
    12·1 answer
  • Finish the format string to get the output shown below.<br> Day<br> &gt;&gt;&gt;{ v8'_format('Day)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!