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
Temka [501]
3 years ago
10

On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * r^n, 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.0 466.1637615180899 493.8833012561241 523.2511306011974 554.3652619537442 Note: Use one statement to compute r = 2^(1/12) using the RaiseToPower() function. Then use that r in subsequent statements that use the formula fn = f0 * r^n with n being 1, 2, 3, and finally 4.
Computers and Technology
1 answer:
vodomira [7]3 years ago
6 0

Answer:

Following are the code to this question:

import math# import math module

def RaiseToPower():   # defining a function RaiseToPower

   r= math.pow(2,1/12)    # defining r variable that calcualte the decimal point value.

   return r # return r variable value.

f0= float(input()) #defining f0 variable that hold input frequency .

for n in range(0,5):#defining for loop to count all frequency

   fn = f * math.pow(RaiseToPower(),n)    # defining fn variable that calls method RaiseToPower and multiply the value by frequency

   print(fn,end=' ')    # use print method to prints all five frequency

Output:

440

440.0 466.1637615180899 493.8833012561241 523.2511306011974 554.3652619537443

Explanation:

Description of the above python code can be defined as follows:

  • In the above code first we import the package of the math module for converting frequency, after importing package a "RaiseToPower" method is declared, inside the method r variable is declared, that counts decimal value and return its value.
  • In the next step, "f0" a frequency variable is declared that input a value from the user and defined a for loop to in the loop fn variable declared, calls the method and pass its input value and stores its decimal points and at the last print its value.

You might be interested in
What is Function of print statement?
trasher [3.6K]

Answer:

To print the statement in the output.

Explanation:

Im a student of C4 and I know this one its In C programming.

6 0
3 years ago
Read 2 more answers
Why might a peer-to-peer network not be the best choice for a large corporate office setting?
omeli [17]

Answer:

a it is less private

Explanation:

8 0
3 years ago
Lukas entered the date 9-17-2013 in an Excel workbook. He wants the date to appears as “Tuesday, September 17, 2013.” Instead of
Sphinxa [80]
<span>The answer is highlight cells, select the Insert tab, click on the number, select Date from the category box, highlight the correct format, and click OK.</span>
8 0
3 years ago
In traditional programming, probably the most often used error-handling outcome was to ____.Group of answer choicesterminate the
iVinArrow [24]

In traditional programming, probably the most often used error-handling outcome was to terminate the program in which the offending statement occurred.

<h3>What is a traditional programming?</h3>

Traditional programming is known to be a form of manual way that one or a user makes a program.

Note that in the case above, In traditional programming, probably the most often used error-handling outcome was to terminate the program in which the offending statement occurred.

Learn more about programming from

brainly.com/question/23275071

#SPJ1

4 0
2 years ago
The process of _____ determines what volume a system can handle by comparing its performance to standards in the industry? horiz
Alina [70]

BENCHMARKING

option C

5 0
3 years ago
Read 2 more answers
Other questions:
  • If you work up to your potential but fall short of your goals, you
    15·2 answers
  • Karen has opened a new business and is using Google Display Ads to build awareness of her new products. How does Google Display
    6·1 answer
  • Create a function (prob3_6) that will do the following: Input a positive scalar integer x. If x is odd, multiply it by 3 and add
    15·1 answer
  • Pleas help 99 points and get brainliest
    9·2 answers
  • Which view in the View tab of the ribbon is the easiest place to add a header or a footer? Normal view Custom Views Page Layout
    5·2 answers
  • Pls help! for computers edge 2021
    7·1 answer
  • Edhesive assignment 1 movie ratings
    9·1 answer
  • Write a short note on Ms - Excel...​..
    7·1 answer
  • Assume that the Vehicle class contains a virtual method named CalculateMaxSpeed(). Assume that both the MotorVehicle and Automob
    12·1 answer
  • Write a two to three sentence response to the following question:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!