"If 'a thirty thousand dollar airplane can sink a forty million dollar battleship,' why build battleships?"
From that web site devoted to: B17-B24-comparison we have this extract:
"Boeing company came up with a design - using 1932 technology - to take a 1 1/2 tonne load over 400 miles to a target and return. The extreme distance was necessitated by the oceans around the USA . . . The bombers were being built to fly out and sink enemy ships before they could get close to the USA."
That mission as originally envisioned by the military planners for the B-17 bomber aircraft WAS NOT for the saturation bombing of enemy cities and dropping the bomb int he pickle barrel from 30,000 feet. That mission rather was to attack and sink enemy warships of the capital ship class as they approached the west and east coasts of the continental United States, the forty-eight contiguous states!
That very anti-ship mission for the high-altitude level bomber dropping ordnance on enemy warships controversial from the very start. A concept thought to be valid based upon the: "The Naval Bombing Experiments Off the Virginia Capes" - - 1921.
Derelict German warships from the era of World War One [WW1], moored, not under steam, not taking evasive action, sunk after repeated attacks by Army Air Corps level bombers [Navy and Marine Corps war planes also involved].
A submarine, destroyer, light cruiser and finally a dreadnought class German battleship going to the bottom after repeated bombing, ALBEIT WITH THE RULES AND PROTOCOLS AS ESTABLISHED IN ADVANCE BEING IGNORED BY THE ARMY AIR CORPS AVIATORS AND COMMANDERS!
[it was not without great difficulty that the German dreadnought Ostfriesland finally went to the bottom, staying afloat for a long time beyond what was expected and absorbing a lot of damage along the way.]
The high-altitude level bomber anti-ship bombing mission of the B-17 found to less than effective during the Second World War [WW2], those instances of such air strikes against Japanese warships found to be wanting in the extreme, the results very poor on a number of occasions! Ships under steam, taking evasive action very hard to hit from high altitude.
"B-17s in the Pacific War"
Battle of the Philippines , Battle of Midway  American airmen flying the maritime strike mission claiming extraordinary results which were not justified!
My understanding is that direct hits of bombs as dropped on warships is not needed to cause damage of a severe nature. Underwater explosions of a "close" nature can break loose riveted hull and cause flooding. A direct impact is not necessarily needed. Warships too have good damage control which mitigates and allows for management of damage minor or severe.