How did the Americans get the Japanese to finally surrender ending World War 2 in august of 1945?

2 Atomic bombs dropped on them