Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions