Final answer:
The heart and lungs are situated in the thoracic cavity, with the heart residing in the pericardial cavity and the lungs in the pleural cavities.
Step-by-step explanation:
The heart and the lungs are located in the thoracic cavity, which is the more superior subdivision of the anterior (ventral) cavity, enclosed by the rib cage. The thoracic cavity is subdivided into two pleural cavities for the lungs and the pericardial cavity within the mediastinum for the heart. The diaphragm forms the floor of the thoracic cavity and separates it from the abdominopelvic cavity, which is further divided into the abdominal cavity and the pelvic cavity.