Home My space log
Language EN (English)

Name the music note

JavaScript Intermediate alien ages 11-13 From CS Unplugged

The problem

Music programs number notes from 0 to 127 (60 is middle C). The names repeat every 12 notes: C, C#, D, Eb, E, F, F#, G, Ab, A, Bb, B. Write a function noteName(number) that gives back the note name.

You will practice: lists, remainder (%), music and maths

Mode

Press Tab to indent. Press Esc and then Tab to move on to the next button.

Your code runs in your browser. We do not receive it or save it.

Test results

      What your code printed

      
          

      CC BY-SA 4.0

      Adapted from a CS Unplugged programming challenge by the University of Canterbury Computer Science Education Research Group, licensed CC BY-SA 4.0.

      Original challenge · License: CC BY-SA 4.0

      Changes: Rewritten in our own words as a function with tests, hints and steps, in Python and JavaScript, by Open Cosmos. This version is also CC BY-SA 4.0.