The ethical dilemma presented mirrors the classic "trolley problem," but applied to autonomous vehicle technology. From a **purely ethical standpoint**, the analysis hinges on competing moral frameworks:

1. **Utilitarian Perspective**:  
   This approach prioritizes the **greatest good for the greatest number**. By this logic, the car should swerve to minimize total fatalities (5 deaths vs. 1). Each life is considered equally valuable, and the action that results in fewer overall deaths is ethically justified. This aligns with the principle of maximizing aggregate well-being.

2. **Deontological Perspective**:  
   Deontological ethics focuses on **duties, rules, and intentions** rather than outcomes. A strict interpretation might argue that the car (or its programmers) should not actively cause harm to the passenger, even to save others. This view emphasizes the moral significance of not *intentionally* sacrificing an innocent individual, even if the consequence is worse overall.

3. **Virtue Ethics and Social Trust**:  
   A virtue-based approach might consider the values a society wishes to cultivate. If self-driving cars prioritize passenger safety at all costs, people may trust and adopt the technology more readily, potentially saving more lives in the long run. Conversely, prioritizing the greater good could foster a culture of collective responsibility.

4. **Rights-Based Considerations**:  
   The passenger’s right to life and the pedestrians’ right to safety conflict here. Some argue the car has a **special obligation to its passenger**, who has entrusted their safety to the vehicle, whereas the pedestrians’ presence on the road may involve unforeseen risk-taking.

### Conclusion:  
While reasonable arguments exist for both choices, **utilitarian reasoning** provides the clearest ethical justification for swerving: saving five lives at the cost of one minimizes net harm and treats all lives as equally valuable. However, this conclusion assumes no additional context (e.g., uncertainty about outcomes, differing moral weights for roles like drivers vs. pedestrians). 

In practice, ethical programming for autonomous vehicles may require balancing competing principles, but the question explicitly asks for a purely ethical judgment. Thus, **the car should swerve** to uphold the utilitarian imperative, prioritizing the action that results in the fewest loss of life. 

This answer does not dismiss the emotional or societal challenges of implementing such a decision but emphasizes that ethics, in isolation, often demands prioritizing the greater good when lives are quantifiably at stake.