I think the problem is poorly worded, which lends itself to the confusion we experience, unless we know (presumably from the context of the goals of this project) that these physical details are beyond the scope of the project.
That is, I think "useful" here is meant as "useful in learning to program", not "useful in actual mass spectra analysis."
Eg, you write "calculate the mass of proteins up to 1000aa".
There's a couple of picky details.
1) The text says "total weight of [A protein string] P", where "The standard weight assigned to each member of the 20-symbol amino acid alphabet is the monoisotopic mass of the corresponding amino acid".
(I'm ignoring that "weight" != "mass" because in this context those are synonyms.)
It reads like the text defines "standard weight" in terms of the monoisotopic mass, and asks to compute that weight. So the problem is not asking to "calculate the mass of proteins up to 1000aa" but "calculate the monoisiotopic mass of proteins up to 1000aa." It further says "all amino acid masses are assumed to be monoisotopic unless otherwise stated".
(Alas, the explanatory text goes on to say "There are two standard ways of computing the mass", which contradicts the assertion that there's a "the standard weight.")
2) It says "protein string" in the problem, not protein, and clarifies that "In the following several problems on applications of mass spectrometry, we avoid the complication of having to distinguish between residues and non-residues by only considering peptides excised from the middle of the protein."
That is, the problem posed was not to calculate the "[monoisotopic] mass of proteins" but something more like the "[monoisotopic] mass of peptides excised from the middle of the protein, represented as a protein string."
3) In trying to understand this @$%@#$%&%$ topic more, I found https://patentimages.storage.googleapis.com/42/6b/2b/ec3a694... which I believe says that for very accurate mass spectrometers, for large proteins, the most abundant mass may be more useful than the average mass.