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
Given a link with a maximum transmission rate of 11.7 Mbps. Only two computers, X and Y, wish to transmit starting at time t = 0
My name is Ann [436]

Missing Details of Question

Statistical multiplexing is used, with details as follows o

- Packet Payload Size = 1000 Bytes

- Packet Header Size = 24 Bytes (overhead)

- Ignore Processing and Queueing delays

- Assume partial packets (packets consisting of less than 1000 Bytes of data) are padded so that they are the same size as full packets.

- Assume continuous alternating-packet transmission.

Answer:

Time = 10.47

Explanation:

Given

Initial Time, t = 0

File X = 14MiB = 14 * 1024 * 1024 = 14,680,064 bytes

File Y = 272KiB = 272 * 1024 = 278528 bytes

Transmission Rate = 11.7Mbps

Total Packet Length is calculated as (1024 * 8)/(11.7Mbps)

Total Packet Length = 8192 ÷ 11700

Total Packet Length = 0.700171 ms/packets

Number of packets

File X = 14,680,064 bytes ÷ 1000 bytes

File X = 14,680.064

File X = 14,680 ---- Approximated

File Y = 278528 bytes ÷ 1000 bytes

File Y = 278.528

File Y = 279 ------- Approximated

Number of Packets = 279 + 14,680

= 14959 packets

The implication of the above is that, File X after a total of 20202 packets are transmitted

File Y will finish transmitting at:

14959 * 0.700171

= 10473.86 ms

= 10.47386 s

= 10.47 s

3 0
3 years ago
What is the first thing you should do when creating a spreadsheet
sashaice [31]
First decide what the rows will represent and what the columns will represent. If you aren't sure use "transpose".
3 0
3 years ago
Aisha designed a web site for her school FBLA club and tested it to see how well it would resize on different systems and device
VARVARA [1.3K]

Answer: responsive

Explanation:

its called mobile responsivness and most good websites have it

5 0
2 years ago
A set of object that share a common structure and common behavior in database is called ​
Tcecarenko [31]
An Object Class. Hopefully this answer is right.
3 0
3 years ago
Give two reasons why mobile internet may not be available everywhere. ​
andreev551 [17]

Answer:

Mobile Internet is dependant on cellular signal. Many countries, e.g. in Africa, don't have any coverage at all. Furthermore, mobile data might also not be available in the mountains as there are no cell towers and the rough terrain usually either blocks the signal entirely or weakens it significantly.

4 0
3 years ago
Other questions:
  • The part of the inside of a computer
    14·1 answer
  • There was a thunderstorm in your area and the power went out.
    12·1 answer
  • When using the =SUM formula, you can add multiple cells together.<br><br> ☐ True<br> ☐ False
    7·1 answer
  • When a communication exchange that does not verify the identity of the endpoints of a communication and accepts any properly for
    10·1 answer
  • The use of _______________ can validate input responses from clients and prevent certain attack methodologies
    14·1 answer
  • Making sure that your business has something special and distinct to offer is known as?
    12·1 answer
  • What will be the code in CSS, to set
    8·1 answer
  • You are the IT Administrator for the CorpNet.local domain. You are in the process of implementing a group strategy for your netw
    13·1 answer
  • Write pseudocode for a function that translates a telephone number with letters in it (such as 1-800-FLOWERS) into the actual ph
    11·1 answer
  • James root lol ........................
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!