1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetach [21]
3 years ago
13

On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance

(number of keys) from that key, and r is 2(1/12). Given an initial key frequency, output that frequency and the next 4 higher key frequencies. Ex: If the input is 440 (the A key near the middle of a piano keyboard), the output is: 440 466.1637615180899 493.8833012561241 523.2511306011974 554.3652619537443 Note: Use one statement to compute r = 2(1/12). Then use that r in subsequent statements that use the formula fn = f0 * rn with n being 1, 2, 3, and finally 4. Note: Import the math module as part of your code to help you compute r = 2(1/12)
Mathematics
1 answer:
ICE Princess25 [194]3 years ago
6 0

Answer:

Program in Java:

import java.util.Scanner;

import java.lang.Math;

public class MyClass {

public static void main(String args[]) {

Scanner input = new Scanner(System.in);

float f0; double r=0.0;

System.out.print("Initial Key Frequency: ");

f0 = input.nextFloat();

int numkey = 1;

System.out.print(f0+" ");

r= Math.pow(2,(1.0/12.0));

while(numkey<=4){

f0*=r;

System.out.print(f0+ " ");

numkey++;

}

}

}

Step-by-step explanation:

This line declares f0 as float and r as double. f0 represents the initial key frequency

float f0; double r=0.0;

This line prompts the user for initial key frequency

System.out.print("Initial Key Frequency: ");

This line gets the initial key frequency from the user

f0 = input.nextFloat();

This declares numkey as integer and also initializes it to 1

int numkey = 1;

This prints the initial key

System.out.print(f0+" ");

This calculates r

r= Math.pow(2,(1.0/12.0));

The following iteration calculates and prints the next 4 key frequencies

<em>while(numkey<=4){</em>

<em> f0*=r;</em>

<em> System.out.print(f0+ " ");</em>

<em> numkey++;</em>

<em>}</em>

}

}

You might be interested in
Tell whether 948 can be divided evenly<br> (is divisible) by 4.
nadya68 [22]

Answer:

yes

Step-by-step explanation:

948 ÷ 4 = 237

4 0
3 years ago
Read 2 more answers
17.5% as a fraction in simplest form?
Vsevolod [243]
17.5\% is the same thing as 0.175. We can rewrite this as \frac{175}{1000}. Or course this is not simplified, so we can simplify to get \boxed{\frac{7}{40}}.
6 0
4 years ago
One half a number increased by three is greater than zero or less than or equal to negative three
Iteru [2.4K]
-3 is the answer to the question
8 0
4 years ago
Read 2 more answers
Helppppp im tired and I cant even think no moreee​
Vladimir [108]

Answer:

The equation of line in the form of Ax + By = C is: \mathbf{4x+y=-17}

Step-by-step explanation:

We need to find the equation of line, with the given slope passes through the given point.

Slope m = -4

Point: (-2,-9)

We need to find slope and y-intercept of the line.

The slope of line is given m = -4

Now, we need to find the y-intercept

Using the point (-2,-9) and slope m = -4, we can find y-intercept

The formula used will be: y=mx-b

Putting values of: y= -9, x =-2 and m = -4

y=mx+b\\-9=-4(-2)+b\\-9=8+b\\b=-9-8\\b=-17

So, y-intercept b = -17

Now, the equation of required line having slope m = -4 and y-intercept b = -17 is:

y=mx+b\\y=-4x-17

Writing equation in required form i.e. of Ax + By = C

y=-4x-17\\4x+y=-17

So, the equation of line in the form of Ax + By = C is: \mathbf{4x+y=-17}

6 0
3 years ago
How many solutions does 5x - 1 = 10x - 4 - 5x + 3 have?
Natasha_Volkova [10]

Answer:

c

Step-by-step explanation:

its c

3 0
3 years ago
Other questions:
  • Compare and contrast perpendicular lines and parallel lines
    15·1 answer
  • al receives $25 weekly allowance. he also babysits his two younger siblings on weekends and is paid $9 per hour. al's friend, Ma
    10·1 answer
  • A square 20 cm long and a rectangle 24 cm long have the same perimeter. Find the area of the rectangle.
    15·1 answer
  • Congruence transfo PLS HELP ME PLEASE
    7·1 answer
  • PLEASE ANSWER FAST AS YOU CAN and answer like
    15·2 answers
  • I will give Brainliest !
    14·1 answer
  • . Which of the following equations is(are)
    8·1 answer
  • When twice a number is increased by 10, the sum is 42.what is the number?
    15·2 answers
  • The sum of two consecutive integers is 299. find the integers.​
    8·2 answers
  • Two vertical angles have measures (4x-21)° and (x+6)°. Find the measures of the angles
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!