Question: Have you ever noticed that when you buy a computer, the hard drive always seems a little smaller than what is advertised? That is because

Have you ever noticed that when you buy a computer, the hard drive always seems a little smaller than what is advertised? That is because hardware manufacturers sell disk drives using the metric system, while computers use base 2. Therefore, a megabyte is sold as 1 million bytes (106) instead of as , or (:220} bytes. Likewise, a gigabyte is sold as one billion bytes (109) bytes, instead of the 1,073,741,824(or 230) bytes. However, since computers still interpret information as powers of 2, the hard drive capacity understood by the computer is much less. Today, the "traditional" gigabyte that was in powers of two is known as a gibibyte (GiB), to distinguish it from the metric version of Gigabyte. Likewise, 220 is referred to as a mebibyte (MiB). To summarize, 1GB=109 bytes, while 1GiB is 230 bytes; 1MB=106 bytes, while 1MiB=220 bytes.
Write a procedure called data_lost () that asks the user for the size of a purchased hard drive (in Gigabytes). Your procedure should then calculate the corresponding number of bytes in gibibytes and the remainder in mebibytes, and output that, along with the number of theoretical bytes lost. You may assume that the user always inputs an integer. Use the built-in function round () to round the remaining mebibytes to the nearest whole number. Sample usage is shown below:
Sample Input/Output 1
Please enter drive size: 300
The drive is actually 279 GiB and 406MiB
This represents a loss of 20GiB and 618MiB
Sample Input/Output 2
Please enter drive size: 500
The drive is actually 465GiB and 677MiB
This represents a loss of 34GiB and 347MiB
 Have you ever noticed that when you buy a computer, the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!