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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started