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
Taya2010 [7]
3 years ago
13

A cashier distributes change using the maximum number of five-dollar bills, followed by one-dollar bills. Write a single stateme

nt that assigns num_ones with the number of distributed one-dollar bills given amount_to_change. Hint: Use %. Sample output with input: 19
Computers and Technology
1 answer:
Gennadij [26K]3 years ago
6 0

Answer:

amount_to_change = int(input("Enter amount to change: "))

num_fives = amount_to_change // 5

num_ones = amount_to_change % 5

print("There are " + str(num_fives) + " five dollars and " + str(num_ones) + " one dollars in the change")

Explanation:

Ask the user to enter the amount_to_change

Calculate the number of five dollars, use floor division

Calculate the number of one dollars, use modulo operator

Print the number of five dollars and number of one dollars

You might be interested in
To enforce the concept of separating class definition from its function implementations, where should the function implementatio
zzz [600]
D(in a .c file ) because that is where it should be placed :)
4 0
3 years ago
Which type of multiplexing divides transmission opportunities into slots of 125 microseconds with position inside each slot rese
Zinaida [17]

Answer: Time division multiplexing

Explanation: because a slot is equivalent to 125ms

And each position inside a slot is for each signal and a single bit frim each voice conversation is sent during each 125ms slot

7 0
3 years ago
The function keys are labeled from f1 to wat
Fed [463]
If we are talking about a simple North American Keyboard, The answer would be F1 to F12
Hope this Helps!!!
8 0
3 years ago
Why we need each section of prologprogram?
evablogger [386]

Answer:

Prolog program are used in the artificial intelligence and the web development in a systematic manner process. As, it is also sometimes known as declarative language which basically consist of some facts and list. Prolog program are divided into the sections that are:

  • Domain sections
  • Clauses sections
  • Predicates sections
  • Goal sections

We need each section of the prolog program because all the sections introduced the systematic program and performed there particular functions so by using all these processing steps an efficient function are formed.

6 0
3 years ago
You are given an unsorted array x of elements that implement the Comparable interface. There are no duplicates in this array. Yo
Andrei [34K]

Answer:

boolean isEven = false;

if (x.length % 2 == 0)

isEven = true;

Comparable currentMax;

int currentMaxIndex;

for (int i = x.length - 1; i >= 1; i--)

{

currentMax = x[i];

currentMaxIndex = i;

for (int j = i - 1; j >= 0; j--)

{

if (((Comparable)currentMax).compareTo(x[j]) < 0)

{

currentMax = x[j];

currentMaxIndex = j;

}

}

x[currentMaxIndex] = x[i];

x[i] = currentMax;

}

Comparable a = null;

Comparable b = null;

if (isEven == true)

{

a = x[x.length/2];

b = x[(x.length/2) - 1];

if ((a).compareTo(b) > 0)

m = a;

else

m = b;

}

else

m = x[x.length/2];

8 0
4 years ago
Other questions:
  • Dfd symbols are referenced by using all ____ letters for the symbol name.
    9·1 answer
  • Kiaan wants to give people who attend his presentation a printed copy of the slides. Instead of printing one slide on each piece
    11·1 answer
  • You need to find out how much ram is installed in a system. what command do you execute to launch the system information utility
    12·1 answer
  • Converting raw data into a more meaningful form is called:
    6·1 answer
  • What element is not a selection in the Interface preferences? UI Character Presets UI Font Size UI Language UI Scaling
    9·1 answer
  • In a Java Script language. create a two-dimension array consisting of numbers representing costs. After creating the array, prin
    11·1 answer
  • Hamad wants to get a car from the used car market. He was shared by the car dealer with list of estimated prices of different mo
    6·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    7·1 answer
  • How can the two independent clauses below be combined to form a correct complete sentence? Check all that apply.
    5·1 answer
  • John has recently retired from an administrative, yet technical job which he held for 40 years. He decided to pursue a life-long
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!