Bytes, not Bits

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

Answer:

(500 x 230) / (10 x 220) == 50 x 210 == 50K files

Bytes, not Bits

The previous table listed the number of bytes, not bits. So one K of memory is 1024 bytes, or 1024*8 == 8,192 bits. Usually one is not particuarly interested in the exact number of bits.

It will be very useful in your future career to be sure you know how to multiply powers of two.


2M  *  2N  =  2(M+N)

In the above, * means multiplication. For example:


26  *  210  =  216

QUESTION 6:

Locations in a digital image are specified by a row number and a column number (both of these are integers). Say that a particular digital image is 1024 rows by 1024 columns, and that each location holds one byte. How many megabytes are in that image?