I think things have changed more recently, but when I was in college it was pretty easy to change from one STEM major to another. I didn't know I liked programing until my first Fortran class.
I did sort of switch as I realized I didn't like college level organic chemistry so just switched to straight Mechanical Engineering from sort of a Biomech thing.