Question: Write a function named numValidNotes that takes an arbitrary string and returns the number of notes expressed in valid SPN that are present within that

Write a function named numValidNotes that takes an arbitrary string and returns the number of notes expressed in valid SPN that are present within that string.

Function Specifications:

The function name: numValidNotes

Parameters (Your function should accept these parameters IN THIS ORDER):

string input: The string to be examined for the number of notes

Return Value: The number of valid notes in the string (int)

This function should make use of your isValidNote function from question 1.

The function should not print anything.

--- Examples ---

Sample function call Expected return value
numValidNotes("I love comp sci!") 0
numValidNotes("F4E2B0") 3
numValidNotes("ADB3M7G4F") 2
numValidNotes("HC6MB1") 2

Your file should be named numValidNotes.cpp and should also include a main function that tests your numValidNotes function. Once you have finished developing your solution in VSCode you should head over to the CodeRunner on Canvas and paste only your numValidNotes function into the answer box for question 3. You do not need to paste your main function or your isValidNote function into Coderunner. These functions have already been provided for you. You will need to include your main, isValidNote, isValidTune and numValidNotes functions in the numValidNotes.cpp file that you submit to Canvas.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!