Isn't "declaring a major" almost synonymous with applying for a degree, presumably the declared major in this case would be "computer science", so requiring some programming knowledge for those declaring that major would be possible?
In theory can one easily go to a USA Uni based on relatively unrelated abilities - lets say history and cooking? - and leave with a degree in Electronic Engineering? If there are no subject-based pre-reqs why does one need to declare a major, or is that done later?
My UK degree was modular so I could have done something quite similar, but I was assessed for entry based on abilities pertinent to a nominated degree (not the one I ended up with as it happens). Modules still had [relatively loose, unassessed] pre-reqs such as reading particular books or understanding specific concepts.