Question: Please write a simple C++ program that matches the notes (keys) on a piano with a number. The notes/keys on a piano are numbered as

Please write a simple C++ program that matches the notes (keys) on a piano with a number. The notes/keys on a piano are numbered as follows, beginning with middle C (since it lies in the middle of the keyboard): C = 1, C# = 2, D = 3, D# = 4, E = 5, F = 6, F# = 7, G = 8, G# = 9, A = 10, A# = 11 and B = 12. As you can see, there are exactly twelve different notes that make up a series of notes on the piano called an octave. On a keyboard, once this octave series of C, C#, D...B is completed, it repeats again an octave higher. The next octave would begin again at C = 13, C# = 14, D = 15all the way to B = 24. The next octave above that would have C = 25, and so on. Each note repeats itself in numeric intervals of 12. We indicate the starting/fundamental octave as C, the next octave above that as C, the next one above that as C, and so forth. For this program, provide a command for a user to enter any number and then display the corresponding note name for it. For example, if a user entered 27, the note D would display. You do not have to list the octaveonly the letter of the note. (If youre wondering why the term octave is used for a span of 12 notes, although there are 12 notes in an octave, 8 of these consist of white keys and 4 of black keys. The entire interval from C to B is named an octave in honor of the white keys. The complete 12-tone series, however, is formally called a dodecaphonic series.)

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!