Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

E 2yBooks On a piano, each key has a frequency, and each subsequent key (black o

ID: 3744992 • Letter: E

Question

E 2yBooks On a piano, each key has a frequency, and each subsequent key (black or white) s a known amount higher For example. The A key above the middle C key has a frequency of 440 Hz Each subsequent key (black or white) h keys from that A key, and r is 2112) Given an initial frequency, output that frequency and the next 4 higher key tequencies. as a frequency of 440 rft where n is the number of Ex If the input is 440, the output is 440 466.1637615180899 493.9833012561 1241 523.2511306011974 534.3652619537443 Note Include one statement to compute r - 2(1o120 using the paw function, then use t in the formule oYoul have four statements using that formula different only in the value for n) ATY31: LAB Musical note frequencies texpressions/assignments D/ 10 LabProgram java Lnad default template, spert 1. 3 Pub33C class LabProgran Java.ut1 1. Scanner; 4publit static void nain strinetd args) Y Scanner seenew Scanner ysten.in,i int freauenc dobie frequencya te 13 Submit mode Pun your rgram as otten as yaue ke betere sucmiting tergraaing Selow tve any needes pregrams outout inte Develop mode nput aues in ge frst box henRun program and observel

Explanation / Answer

import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner in = new Scanner(System.in); int f = in.nextInt(); double r = Math.pow(2, 1.0/12); System.out.println(f + " " + f*Math.pow(r, 1) + " " + f*Math.pow(r, 2) + " " + f*Math.pow(r, 3) + " " + f*Math.pow(r, 4)); } }