"to strike sharply," 1719, probably of imitative origin. The noun is from 1737. The word in out of whack (1885) is perhaps the slang meaning "share, just portion" (1785), which may be from the notion of the blow that divides, or the rap of the auctioneer's hammer.
To masturbate; jerk off
[1960s+; one of the many terms equating masturbation with banging, beating, or pounding]
[probably echoic; in second verb sense, the use of whacks, ''any form of force,'' is attested among Chicago gunmen in 1932]