Driver has to pump brake pedal multiple times to brake

When I first started my car, the brakes would not operate. While I backed out of my driveway, I tried pressing on the brake pedal several times by pumping the brake pedal more than eight times to get the brake system to engage. There was another instance where I was driving about 5 mph and the brakes stopped functioning and my car rolled until it independently stopped. I went to the dealer and was told that my car needed a new pump that will assist the braking system to build up pressure so that the brakes will engage. Before I agree to this, would you please give me your diagnosis of this pro

– Driver has to pump brake pedal multiple times to brake