Just because I seen someone else ask but they didn't have enough information.

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 storage. 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 total number of bytes needed to store a file of a given size?

Just Because I Seen Someone Else Ask But They Didn't Have Enough Information.If A Filesystem Has A Block

Answers

Answer 1

Answer:

Following are the program to the given question:

def calculate_storage(filesize):#definging a method calculate_storage that takes filesize as a parameter  

 block_size = 4096#definging block_size that holds value

 full_blocks = filesize//block_size#definging full_blocks that divides the value and hold integer part

 partial_block_remainder = filesize%block_size#definging partial_block_remainder that holds remainder value

 if partial_block_remainder > 0:#definging if that compare the value

   return block_size*full_blocks+block_size#return value

 return block_size*full_blocks#return value

print(calculate_storage(1))    # calling method by passing value

print(calculate_storage(4096)) # calling method by passing value

print(calculate_storage(4097)) # calling method by passing value

Output:

4096

4096

8192

Explanation:

In this code, a method "calculate_storage" is declared that holds a value "filesize" in its parameters, inside the method "block_size" is declared that holds an integer value, and defines "full_blocks and partial_block_remainder" variable that holds the quotient and remainder value and use it to check its value and return its calculated value. Outside the method, three print method is declared that calls the method and prints its return value.


Related Questions

You find an unnamed fluid in the lab we will call Fluid A. Fluid A has a specific gravity of 1.65 and a dynamic viscosity of 210 centipoise [cP]. What is the kinematic viscosity of Fluid A, in units of stokes [St]

Answers

Answer:

1.2727 stokes

Explanation:

specific gravity of fluid A = 1.65

Dynamic viscosity = 210 centipoise

Calculate the kinematic viscosity of Fluid A

First step : determine the density of fluid A

Pa = Pw * Specific gravity =  1000 * 1.65 = 1650 kg/m^3

next : convert dynamic viscosity to kg/m-s

210 centipoise = 0.21 kg/m-s

Kinetic viscosity of Fluid A = dynamic viscosity / density of fluid A

                                            = 0.21 / 1650 = 1.2727 * 10^-4 m^2/sec

Convert to stokes = 1.2727 stokes

find the volume of the pond with the following dimension length 40m breadth 10m height 1.2m depth 0.9m express in both meters and feet​

Answers

Answer:

The volume for this is 29.7

Explanation:

Trust me on this I'm an expert

A copper block receives heat from two different sources: 5 kW from a source at 1500 K and 3 kW from a source at 1000 K. It loses heat to atmosphere at 300 K. Assuming the block to be at steady state, determine (a) the net rate of heat transfer in kW; (b) the rate of entropy generation in the system's universe

Answers

Answer:

a) Zero

b) the rate of entropy generation in the system's universe = ds/dt = 0.2603 KW/K

Explanation:

a) In steady state  

Net rate of Heat transfer = net rate of heat gain -  net rate of heat lost  

Hence, the rate of heat transfer = 0

b) In steady state, entropy generated  

ds/dt = - [ Qgain/Th1 + Qgain/Th2 - Qlost/300 K]

Substituting the given values, we get –  

ds/dt = -[5/1500 + 3/1000 – (5+3)/300]

ds/dt = - [0.0033 + 0.003 -0.2666]

ds/dt = 0.2603 KW/K

 

Một máy nghiền bi thùng ngắn đường kính D = 1.6m, dài L = 2m dùng để nghiền VL. Kích thước đầu vào D1 = 20mm, sản phẩm sau nghiền có kết quả phân tích rây sau:


Số mesh
60/80
80/100
100/150
150/200
Khối lượng VL trên rây
0.1
0.3
2.5
0.1


Hỏi
1. Tính kích thước bi nghiền bi.
2. Tính số vòng quay tối ưu.
3. Tính năng suất (biết K1 = 1.01).
4. Tính số lượng bi cần nạp vào thùng. Biết hệ số chứa đầy φ = 0.25, hệ số rỗng = 0.65, ⍴bi = 8000 kg/m3

Answers

Answer:

bood ekogcd gcaerh is an American fbnuxc

Ideally speaking, bonds tend to form between two particles such that they are separated by a distance where force is exerted on them, and their overall energy is:________
a. a negative, minimized
b. a positive, minimized
c. zero, minimized
d. zero, maximized
e. a positive, maximized
f. a negative, maximized

Answers

Answer:

a g i

Explanation:

nnj

In a certain pressing operation, the metallic powder fed into the open die has a packing factor of 0.5. The pressing operation reduces the powders to 70% of their starting volume. In the subsequent sintering operation, shrinkage amounts to 10% on a volume basis. Given that these are the only factors that affect the structure of the finished part, determine its final porosity.

Answers

Answer:

0.2063

Explanation:

Given data:

packing factor = 0.5

percentage of reduction of powders = 70%

Calculate the final porosity

after sintering Bulk specific volume = 0.9 * 0.7 = 0.63

assuming true specific volume = 1

packing factor = 0.5 , bulk specific volume = 2

packing factor after pressing and sintering

= 1 / ( 2 * 0.63 ) = 0.7937

hence : porosity = 1 - packing factor

                            = 1 - 0.7937 = 0.2063

Please label the following statements as either True (T) or False (F).
(a) The true stress is higher than the engineering stress for a sample under tension.
(b) Creep test is carried out with a dynamic stress under elevated temperature.

Answers

Answer:

a. True

b. False

Explanation:

a. Since true stress, σ' = σ(1 + ε) where σ = engineering stress and ε = engineering strain.

Also under tension ε > 0, so, (1 + ε) > 1

Since (1 + ε) = σ'/σ > 1, ⇒ σ' > σ

So, the true stress is greater than the engineering stress.

So, the statement is true

b. Creep is a time-dependent deformation under certain applied load.

Creep occurs at high temperatures under different types of stress.

But, Creep test is carried out at constant high temperature and constant stress.

This statement is false.

Other Questions
In Antigone, what is the chorus made up of and what does it represent? A. It's made up of Creon's friends and represents his royal courtiers. B. It's made up of the Theban elders and represents the Theban citizens. C. It's made up of women and children and represents the Theban minority. D. It's made up of Oedipuss family and represents the sorrowful state of their lives. Part 1: Solve for the slope of the line inside of the scatter plot How does Romeo miss the message from Friar Laurence about the secret plan? MATH PROBLEM 20 POINTS the acceleration of a moving vehicles is 10 metre per second square what does it means It is important not to apologize or make excuses to the audience becausea.no one cares about excuses.c.it can be embarrassing.b.you ruin your credibility with the audience.d.you will forget your main subject. When 4 is added to three times of a number, the answer is the same as subtracting 2 from the number. What is the number ? Read this excerpt from Silent Spring.Then a strange blight crept over the area and everything began to change. Some evil spell had settled on the community: mysterious maladies swept the flocks of chickens; the cattle and sheep sickened and died. Everywhere was a shadow of death. The farmers spoke of much illness among their families.Which word best describes the tone used in both excerpts?frustratedpassionatewishfulinsincere Question 10 (1 point) Find the volume of the figure. 2.5 ft 3 ft 2 ft 6 ft. What is the volume of the figure? so I HAVE AN EXAM I A FEW MINUTES AND THIS ISNT CORRECTED AND FROM GOOGL TRANSLATE. CAN SOMEBODY PLEASE CORRECT THIS? 20. What is the next term in the following sequence:Please hurry In the figure, ALM BLM by Side-Angle-Side (SAS). Which angles are congruent by CPCTC? What is the correct form of the verb in the preterite tense.El profesor _______________ en la clase (entrar) Consider the following simple regression model: y = 0 + 1 x 1 + u. In order to obtain consistent estimators of 0 and 1, when x and u are correlated, a new variable z is introduced into the model which satisfies the following two conditions: Cov( z, x) 0 and Cov ( z, u) = 0. The variable z is called a(n) _____ variable. dummy instrumental lagged dependent random Put these numbers in order from greatest to least.0.24,0.73,1/4, and 3/4 How many dimensions does a plane have?OA. ThreeB. ZeroO C. TwoD. One Hello, I need help with this math question please What is trench warfare, and why was so much of World War I dominated by this method of fighting? Which instrument changes kinetic energy into electrical energy?electric motorhair drierelectric belldynamo How can business activity affect the government?