This example is a compound sentence.
Compound sentences contain two or more independent clauses, in which each one possesses its own subject and verb. Each independent clause needs to have a complete meaning and must stand on its own. In this case, Ted cooked the dinner is an independent clause and Janet ate it is the other clause. They are joined by the coordinating conjunction and.