아니요, 남자아이는 여자가 아닙니다 : Why would the sentence start with '요 ' (아니요) and end with 'ㅂ니다' (아닙니다)? I thought both were used in different levels of formality. Is it correct for the same sentence to use both of these endings?
In a very formal situation, one may consistently use -합니다 for every sentence. In other cases, one could also use -해요 for every sentence. However, it's not unusual for these endings to appear together in the same paragraph. (Appearing together in the same sentence might be less common, simply because a sentence usually only contains one such sentence ending - but see the comment thread above.)
Here's one example I found from a popular children's book (구름빵):
"있잖아, 나 배고파." 동생이 말했어요.
"하늘을 날아다녀서 그럴 거야. 우리, 구름빵 하나씩 더 먹을까?"
동생과 나는 구름빵을 또 먹었어요.
구름을 바라보며 먹는 구름빵은 정말 맛있었습니다.