The smaller square in the figure below has a perimeter of $4$ cm, and the larger square has an area of $16$ $\text{cm}^2$.  What is the distance from point $A$ to point $B$? Express your answer as a decimal to the nearest tenth.

[asy]
draw((0,0)--(12,0));
draw((2,0)--(2,10));
draw((0,0)--(0,2));
draw((0,2)--(2,2));
draw((0,2)--(12,10));
draw((12,0)--(12,10));
draw((2,10)--(12,10));
label("B",(0,2),W);
label("A",(12,10),E);
[/asy]
Since the smaller square has a perimeter of 4 cm and its sides are equal in length, each side measures $4/4=1$ cm. Since the larger square has area 16 square cm, each side measures $\sqrt{16}=4$ cm. To find the length of $AB$, we draw a right triangle with $AB$ as the hypotenuse and the two sides parallel to the sides of the squares, as shown below: [asy]
draw((0,0)--(12,0));
draw((2,0)--(2,10));
draw((0,0)--(0,2));
draw((0,2)--(2,2));
draw((0,2)--(12,10));
draw((12,0)--(12,10));
draw((2,10)--(12,10));
draw((0,2)--(12,2)--(12,10),dashed);
label("B",(0,2),W);
label("A",(12,10),E);[/asy] The horizontal side has length $1+4=5$ (the length of the smaller square and the length of the larger square added together) and the vertical side has length $4-1=3$ (the length of the larger square minus the length of the smaller square). Using the Pythagorean Theorem, the length of $AB$ is $\sqrt{5^2+3^2}=\sqrt{34}\approx\boxed{5.8}$ cm.