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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education