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
miskamm [114]
4 years ago
6

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 Change for $ 19 3 five dollar bill(s) and 4 one dollar bill(s)
Computers and Technology
1 answer:
Allushta [10]4 years ago
4 0

Answer:

<em>num_ones = amount_to_change % 5</em>

Explanation:

It is given that the cashier has to change the money in the maximum number of 5 dollar bills and remaining as $1 bills.

We have to write a single statement of code to assign the value to variable <em>num_ones </em>to find the value of $1 bills given <em>amount_to_change.</em>

<em />

Let us solve this by taking example:

If <em>amount_to_change </em>= $19

Then total number of $5 bills that can be given is 3. And amount that can be given as $5 bills is \bold{3 \times 5  = \$15}

So, the remaining amount i.e. $19 - $15 = $4 will be given as one dollar bills.

Out of these $19, 4 bills of $1 can be found using the <em>Modulus (%) operator.</em>

<em></em>

Modulus operator leaves the remainder i.e.

Output of <em>p % q </em>is the remainder when a number 'p' is divided by 'q'.

19 % 5 = 4

4 is the number of one dollar bills to be given.

So, single line of code for the number of one dollar bills can be written as:

<em>num_ones = amount_to_change % 5</em>

<em />

<em />

Let us try it for <em>amount_to_change  = </em>$30

We know that 6 number of $5 bills can be used to change the amount of $30 and no one dollar bill required.

<em>num_ones = 30 % 5 = </em>0 (because 30 is completely divisible by 5 so remainder is 0)

So, the correct statement is:

<em>num_ones = amount_to_change % 5</em>

You might be interested in
The ________ coordinates the flow of data and information through the computer system by coordinating the hardware, software, us
Irina-Kira [14]

Answer:

Operating System.

Explanation:

All the properties listed in the question are handled by the Operating system.

Operating system:-It is a software that manages the computer hardware,provides common services for the programs of the computer and software resources.

Some of the most popular operating systems are as following:-

  1. Microsoft Windows.
  2. Apple MACOS
  3. Linux.

There are also other operating systems present out there these are some of the mostly used OS's.

8 0
3 years ago
Question 3 / 5
Andrej [43]

Answer:

False

Explanation:

3 0
3 years ago
Design a 128KB direct-mapped data cache that uses a 32-bit address and 16 bytes per block. The design consists of two components
Kitty [74]

Answer:

See the attached pictures for detailed answer.

Explanation:

The cache contain 8K number of blocks.each block has 16 Byte worth of data. Each of these bytes are addressable by block offset. Now, each of these blocks are addressable and their address is provided by line offset or set offset. If block number is given in Decimal format then the block to which that block will be mapped is given by expression

mappedToBlock = (bNumber)mod2​​​13

TAG and valid but consititues something called cache controller. TAG holds the physical address information because the TAG in physical address get divided into TAG and line offset in cache address. Valid bit tells status of blocks. If it is 1 then data blocks are referred by CPI else not.

7 0
3 years ago
you work in the Human Resources department of a company that has partnered with a similar company in Brazil on a big contract. y
Phoenix [80]

Answer:

Option C: Organizational Chart.

Explanation:

The main goal, in this case, it's to help the team to know the company and its integrants.

An organizational chart -- also called organigram -- is the best tool to clarify how the Brazilian company works.

The organigram is a diagram that illustrates the structure of an organization, how one part its related to another, and the assigned responsibilities of each specific department. Through this tool, the team will have a clear idea of who their counterparts are and how their job is related to ours.

4 0
3 years ago
Define horizontal scroll bar​
Murrr4er [49]

Answer:

the thing thats on the bottom of your page when you zoom in that makes the page go left and right.

Explanation: birb

4 0
2 years ago
Read 2 more answers
Other questions:
  • Your program will demonstrate use of arrays, searching an array, using methods, passing parameters by reference, returning value
    13·1 answer
  • What is the purpose of an index page feature in a Word document? Check all that apply.
    6·2 answers
  • Which payment method typically charge is the highest interest rates?
    12·1 answer
  • The following types of websites are
    10·1 answer
  • Monica spent a lot of time preparing for her interview, but the hiring manager is not asking any of the questions she practiced.
    9·2 answers
  • A marketing firm has been hired to help a client understand how their online brand is perceived. The firm has set up a system to
    14·1 answer
  • I get brainlist to whoever can help my computer is doing this and I have class and it’s not working and I got it wet yesterday b
    12·2 answers
  • What kind of block do you need to check whether a sprite is touching another sprite?
    10·1 answer
  • If you use a new HTML5 input type (such as "range" or "number") on an older browser,
    12·1 answer
  • What are the different elements of a window?​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!