Compositional Design Of Cyber-Physical Systems Using Contracts