Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Task When playing music on an Eb Alto Saxophone, the fingers press some keys more than others. For simplicity assume that the music is
The Task When playing music on an Eb Alto Saxophone, the fingers press some keys more than others. For simplicity assume that the music is composed of only 14 different notes. They are: CDEFGAB in one octave and CDEFGAB in a higher octave. We use c,d,e,fg,a,b,C,D,E,F,G,A,B to represent them. The fingers typically used for each note are: c: finger 2-4, 7-10 d: finger 2-4, 7-9 e: finger 2-4,7,8 f: finger 2-4,7 . g: finger 2-4 a: finger 2,3 b: finger 2 C: finger 3 D: finger 1-4, 7-9 E: finger 1-4,7,8 . F: finger 1-4,7 G: finger 1-4 A: finger 1-3 B: finger 1-2 (Note that every finger is controlling a specific key, different fingers are controlling different keys.) A finger presses a key if it is needed in a note, and if that same finger is not used in the note previously played. Naturally, every key needed for the first note is pressed because there is no previous note. Write a program to count the number of times each finger presses one of the keys. Input and Output Specification Each line in the input stream contains one song. The only characters allowed in the song are "cdefgabCDEFGAB". There are at most 200 notes in a song, and the song may be empty. For each test case, print 10 numbers indicating the number of presses for each finger. Numbers are separated by a single space. Sample Input cdefgab BAGFEDC CbCaDCbCbCCbCbabcCbCbabae Sample Output 0 1 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 0 1 8 10 2 0 0 2 2 1 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started