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
A mother decides to teach her son about a letter each day of the week. She will choose a letter from the name of the day. For ex
avanturin [10]

Answer:

Check Explanation

Step-by-step explanation:

The days of the week include

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

a) So, the possible letters to be taught include

A, D, E, F, H, I, M, N, O, R, S, T, U, W, Y

There are indeed 15 possible letters.

These are the letters from which all the days of the week are formed from.

b) There are more than 4 letters that can't be taught using this method.

All the letters that cannot be taught using this method because no day of the week contains them include

B, C, G, J, K, L, P, Q, V, X, Z

c) In Tuesday, there are 7 distinct letters.

So, the sample space consist of 7 letters.

n(sample space) = 7

n(Y) = 1

Probability of picking a Y = (1/7)

The reasoning is simple, picking a Y on a Tuesday is one out of 7 possible outcomes, so, the probability of picking a Y on a Tuesday to teach the kid about = (1/7) = 0.143

Hope this Helps!!!

6 0
3 years ago
A school typically sells 500 year books in a year for $50 each. the economics class does a project and discovers that they can s
zysi [14]

The answer is $40

500*50x=25,000

625*40x=25,000

7 0
3 years ago
Assume that a​ student's alarm clock has a 11.2 ​% daily failure rate. What is the probability that the​ student's alarm clock w
postnew [5]
Daily failure rate = probability that it will not work on any particular day.


6 0
3 years ago
What is more .48 or .6?
PSYCHO15rus [73]

.6 is more than .48.

If you appreciated my answer, please thank and brainliest me!

4 0
3 years ago
Read 2 more answers
A length of rope is stretched between the top edge of a building and a stake in the ground. The rope also touches a tree halfway
mestny [16]

the tree is 8 ft because it is half of the building


3 0
3 years ago
Other questions:
  • How much money is 200 quarters 150 dimes and 300 pennies?
    5·1 answer
  • The sum of three consecutive odd numbers is 177. What is the smallest of the three numbers?
    13·2 answers
  • Which one is more precise 7m ; 7.7m
    9·2 answers
  • Simplest form of the expression -2x2(x – 5) + x(2x2 – 10x) + x is
    11·1 answer
  • An orange is divided into 6 equal wedges.Jody eats 1 wedges.How much of the orange did Jody eat?
    7·2 answers
  • Use the binomial theorem to expand the binomial(simple steps).<br> (d-4b)^3<br> Urgent help needed
    7·1 answer
  • Keisha's suitcase weighs 51.4 pounds. Which statement is not true?
    7·1 answer
  • A survey of 391 children given at a local elementary school showed that 150 like chocolate ice cream 125 like pistachio ice crea
    7·1 answer
  • Please help and how do you know this answer
    8·2 answers
  • write the possible range of the measurement 214 ounces +1.2% round to the nearest hundredth if necessary
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!