Gold makes sharp gains in electronic trading as dollar weakens