What exactly do you want to learn?
If this is some programming exercise, then the solution will depend on the programming environment in question.
As for the logic: You could filter out the first word in a sentence as not being a name. To separate sentences you must look for .!? closing characters.
Also note, that the first word can be a name; not everything within the sentence that starts with an uppercase letter is a name (citations or book titles for example); a dot (.) can appear within a sentence for computer related text (filename); etc. Syntax errors can happen also, but for error checking you will need dictionary look-ups.
A simple project like this can grow into a complex one, without having started any coding yet.