Using C++ write this code Write a function called isValidNote that accepts a string and returns true if that string is a valid note expressed in SPN and false otherwise. See the explanation above for clarity on what is and is not considered valid SPN. Function Specifications: Name: isValidNote() Parameters (Your function should accept these parameters IN THIS ORDER): note (string): The string to be checked Return Value: True or false (bool) The function should return true if the string is a valid note in SPN and false otherwise. The function should not print anything. The function should be case-sensitive, e.g. B0 is valid SPN but b0 is not. Hint: Any note expressed in valid SPN will be exactly 2 characters long. --- Examples --- Sample function call Expected return value isValidNote("y") False isValidNote("D4") True isValidNote("d4") False isValidNote("E72") False isValidNote("I love coding") False Your file should be named isValidNote.cpp and should also include a main function that tests your isValidNote function. Once you have finished developing your solution in VSCode you should head over to the CodeRunner on Canvas and paste only your function isValidNote into the answer box for question 1. You do not need to paste your main function into Coderunner, one has already been provided for you. You will need to include your main and isValidNote functions in the isValidNote.cpp file that you submit to Canvas.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question

Using C++ write this code

Write a function called isValidNote that accepts a string and returns true if that string is a valid note expressed in SPN and false otherwise. See the explanation above for clarity on what is and is not considered valid SPN.

Function Specifications:

  • Name: isValidNote()
  • Parameters (Your function should accept these parameters IN THIS ORDER):
    • note (string): The string to be checked
  • Return Value: True or false (bool)
  • The function should return true if the string is a valid note in SPN and false otherwise.
  • The function should not print anything.
  • The function should be case-sensitive, e.g. B0 is valid SPN but b0 is not.

Hint: Any note expressed in valid SPN will be exactly 2 characters long.

--- Examples ---

Sample function call Expected return value
isValidNote("y") False
isValidNote("D4") True
isValidNote("d4") False
isValidNote("E72") False
isValidNote("I love coding") False

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

Write a function called isValidNote that accepts a string and returns true if that string is a valid note expressed in SPN and false otherwise.
See the explanation above for clarity on what is and is not considered valid SPN.
Function Specifications:
• Name: isValidNote()
Parameters (Your function should accept these parameters IN THIS ORDER):
o note (string): The string to be checked
●
• Return Value: True or false (bool)
• The function should return true if the string is a valid note in SPN and false otherwise.
• The function should not print anything.
• The function should be case-sensitive, e.g. BO is valid SPN but bo is not.
Hint: Any note expressed in valid SPN will be exactly 2 characters long.
Examples
Sample function call
isValidNote("y")
isValidNote("D4")
isValidNote("d4")
isValidNote("E72")
isValidNote("I love coding")
Expected return value
False
True
False
False
False
Your file should be named isValidNote.cpp and should also include a main function that tests your isValidNote function. Once you have
finished developing your solution in VSCode you should head over to the CodeRunner on Canvas and paste only your function isValidNote
into the answer box for question 1. You do not need to paste your main function into Coderunner, one has already been provided for you.
You will need to include your main and isValidNote functions in the isValidNote.cpp file that you submit to Canvas.
Transcribed Image Text:Write a function called isValidNote that accepts a string and returns true if that string is a valid note expressed in SPN and false otherwise. See the explanation above for clarity on what is and is not considered valid SPN. Function Specifications: • Name: isValidNote() Parameters (Your function should accept these parameters IN THIS ORDER): o note (string): The string to be checked ● • Return Value: True or false (bool) • The function should return true if the string is a valid note in SPN and false otherwise. • The function should not print anything. • The function should be case-sensitive, e.g. BO is valid SPN but bo is not. Hint: Any note expressed in valid SPN will be exactly 2 characters long. Examples Sample function call isValidNote("y") isValidNote("D4") isValidNote("d4") isValidNote("E72") isValidNote("I love coding") Expected return value False True False False False Your file should be named isValidNote.cpp and should also include a main function that tests your isValidNote function. Once you have finished developing your solution in VSCode you should head over to the CodeRunner on Canvas and paste only your function isValidNote into the answer box for question 1. You do not need to paste your main function into Coderunner, one has already been provided for you. You will need to include your main and isValidNote functions in the isValidNote.cpp file that you submit to Canvas.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr