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
vagabundo [1.1K]
3 years ago
8

If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s

torage. A file made up of 4097 bytes will use 4096*2=8192 bytes of storage. Knowing this, can you fill in the gaps in the calculate_storage function below, which calculates the storage size needed for a given filesize?
def calculate_storage(filesize):
block_size = 4096
# Use floor division to calculate how many blocks are fully occupied
full_blocks = _
# Use the modulo operator to check whether there's any remainder
partial_block =
# Depending on whether there's a remainder or not, return the right number.
if partial_block > 0:
return
return ___ Run

print(calculate_storage(1)) # Should be 4096
print(calculate_storage(4096)) # Should be 4096
print(calculate_storage(4097)) # Should be 8192 Reset
Computers and Technology
2 answers:
jenyasd209 [6]3 years ago
8 0

Answer:

Python code given below

Explanation:

def calculate_storage(filesize):

   block_size = 4096

   full_blocks = filesize // block_size

   partial_block = filesize % block_size

   if partial_block > 0:

       return (full_blocks + 1) * block_size

   return filesize

print(calculate_storage(1))

print(calculate_storage(4096))

print(calculate_storage(4097))

Lubov Fominskaja [6]3 years ago
6 0

Answer:

The response resonates with a python code that is shown in the explanation below

Explanation:

def calculate_storage(filesize):

 block_size = 4096

  full_blocks = filesize // block_size

  partial_block = filesize % block_size

  if partial_block > 0:

      return (full_blocks + 1) * block_size

  return filesize

print(calculate_storage(1))

print(calculate_storage(4096))

print(calculate_storage(4097))

You might be interested in
__________ intelligence is an approach to boundary spanning which results from using sophisticated software to search through in
lbvjy [14]

Answer:

Business Intelligence

Explanation:

The approach uses tools to access & analyze data sets and present analytical findings in reports, summaries, dashboards, maps, charts and graphs to provide users with detailed intelligence about the state of the business.

Business intelligence uses softwares and services to convert data into actionable insights that inform an organization’s strategic and tactical business decisions.

6 0
3 years ago
Where does Reiner take eren after they have a fight?
Tom [10]

Answer:

So Reiner And Bertoldt wanted to take Eren and Ymir to Marley, a nation on the other side of the ocean so they can be devoured and there power can be given to a warrior canidate.

5 0
3 years ago
Read 2 more answers
The inflationary gap occurs when you obtain no increase in output, but only an increase in the Average Price Level from an incre
Katarina [22]
<span>B. Second phase of the Keynesian LRAS Curve.</span>
8 0
3 years ago
This is a tableware use to serve the main dish
GuDViN [60]

Answer:

<em>Dinner plate is a type of plate used for main courses. The average dinner plate measures 11 or 12 inches across. This plate is the most used plate during the entire meal and it usually comes out after the salad, it is the plate resting just above the charger.</em>

6 0
3 years ago
what would happen if a large number of computer users are attempting to access a web site at the same time that you are
jasenka [17]
It would slow down the whole network if your on the same one

6 0
4 years ago
Read 2 more answers
Other questions:
  • Suppose an array with six rows and eight columns is stored in row major order starting at address 20 (base 10). If each entry in
    8·1 answer
  • 7.
    6·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • Which of the following code segments could be used to skip the first two characters of an input line (they may or may not be whi
    13·1 answer
  • 2. What is an inanimate object? (1.0 points)
    14·1 answer
  • How ssd is better than normal sata and pata HDD​
    11·1 answer
  • Identify the angle.
    12·1 answer
  • Write a program that produces an expense report for a trip to Lagos, Nigeria. Use the Internet to research the cost to travel to
    13·1 answer
  • How to use emojis on chromebook without on-screen keyboard
    14·1 answer
  • I have a problem. I can't cycle between game packs on my strike pack, I've watched so many vids I'm on Xböx and I'm holding the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!