Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// DATE: // NETID: // COLLABORATORS: /* ALGORITHM PSEUDOCODE Ask user to input number of scores that will be inputed and save to char array Validate input and convert to integers (check that input number of scores is not negative or has no invalid characters in it) Use this to set the size of the array that will hold all the scores entered While we do not have all of the scores in the array Get the input Check if the input has a negative sign first (this is not an integer) Call your function that checks is the input has a '-' at the beginning and find out The function result in either true (score is invalid, and we must ask the user to re-enter) or false (score is valid, and we must next check if all characters are digits) If function returns true, then the input is invalid because it could potentially be negative If function returns false, then: Check if the input contains only digits, and no characters Call another function to check that all characters are digits The function will return either false (score is invalid, and we must
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online