Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in Java Implement another enumeration, Beat.java to represent the duration of a note: Beat WHOLE THREEQUARTER HALF THREEEIGHTH QUARTER THREESIXTEENTH EIGHTH SIXTEENTH getBeats(): double

Code in Java

image text in transcribed

Implement another enumeration, Beat.java to represent the duration of a note: Beat WHOLE THREEQUARTER HALF THREEEIGHTH QUARTER THREESIXTEENTH EIGHTH SIXTEENTH getBeats(): double getDuration(int): double toString0 : String Assuming the music is in standard time, a quarter note plays for a duration of 1 beat. The other beats are defined predictably in terms of the quarter note: Beats Value WHOLE THREEQUARTER HALF THREEEIGHTH QUARTER THREESIXTEENTH EIGHTH SIXTEENTH 1 3/4 1/2 1/4 | The getBeats() method simply returns the values from the above table. The method getDuration calculates the time, in seconds, that the note should be played given a tempo in units of beats per minute. The input says how many quarter notes can be played in 60 seconds, and the output is the number of seconds it takes to play the beat ((60.0 * beats) / tempo). The toString() method prints the fraction of a WHOLE note that the beat represents, wrapped in parentheses. For example, Beat. WHOLE.toString() returns " (1) ", Beat . QUARTER.toString() returns" (1/4)", and Beat. THREESIXTEENTH.toString() returns" (3/16)". Again, you can add private attributes to the enumeration to make the method easier to define

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 Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions