Answer:
Program for the above question in python:
mass = float(input("Enter the mass in grams")) # It is used to take the mass as input.
density = float(input("Enter the density grams per cm cube")) # It is used to take the input for the grams.
print("Volume ={:.2f}".format(mass/density)) #It is used to print the Volume.
Output:
- If the user inputs as 2.98 and 3.2, then it will results as 0.92.
Explanation:
- The above code is in python language, in which the first statement is used to take the inputs from the user for the mass and sore it into a mass variable.
- Then the second statement also takes the input from the user and store it into a density variable.
- Then the third statement of the code is used to print the volume up to two places using the above-defined formula.
Answer:
The complete program is as follows:
def convert_distance(miles):
km = miles * 1.6 # approximately 1.6 km in 1 mile
return km
my_trip_miles = 55
# 2) Convert my_trip_miles to kilometers by calling the function above
my_trip_km =convert_distance(my_trip_miles) #3) Fill in the blank to print the result of the conversion
# 4) Calculate the round-trip in kilometers by doubling the result,
print("The distance in kilometers is " +str(my_trip_km))
# and fill in the blank to print the result
print("The round-trip in kilometers is " + str(my_trip_km * 2))
Explanation:
<em>The program is self-explanatory because I used the same comments in the original question.</em>
B false data does not only have to be facts
D. consider how long you plan to keep your money in the investment.
Answer:
The answer is provided in the form of explanation
Explanation:
A page fault occurs means that the required page is not in main memory. First OS check for
page in the cache memory, if the page is present then retrieved but if not present then check for
page in main memory and if the page is not present here too then it searches for page in hard
drive. To calculate the expected time, the following formula is used:
Cache hit ratio = 95% = 0.95
Cache miss ratio = 5% = 0.05
Cache access time = 2 millisecond
The average access time of hard drive = 30 milliseconds
Expected time = Hit ratio (cache access time +memory access time) + Miss ratio (cache
access time + 2 * memory access time)
= 0.95 (2+30) + 0.05 (2+2*30)
= 0.95 (32) + 0.05(62)
=30.4 + 3.1
= 33.5 millisecond
Expected time = cache hit ratio * cache access time + (1 – hit ratio) * cache miss ratio
= 0.95*2+(1-0.95)*0.05
= 1.9025