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
kondaur [170]
3 years ago
7

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.0/12.0). Given an initial key frequency, output that frequency and the next 4 higher key frequencies.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
printf("%0.21f", yourValue);
Ex: If the input is 440 (the A key near the middle of a piano keyboard), the output is:
440.0, 466.16, 493.88, 523.25, 554.36
Computers and Technology
1 answer:
Solnce55 [7]3 years ago
6 0

Answer:

#include<iostream>

#include<cmath>

using namespace std;

int main()

{

float f0;

//Prompt user for input

cout<<"Enter Initial Key Frequency: ";

cin>>f0;

//Initialize number of keys

int numkey = 1;

//Print first key frequency

printf("%0.2f", f0);

cout<<" ";

while(numkey<=4)

{

 f0*= pow(2,(1.0/12.0));

 printf("%0.2f", f0);

 cout<<" ";

 numkey++;

}

return 0;  

}

Explanation:

Line 4 declares fo (the key frequency) as float

Line 6 prompts user for input

Line 7 accepts input

Line 9 initializes number of keys  to 1

Line 11 prints first key frequency  (the input from the user)

Line 12 - 18 is an iteration that calculates and print key frequencies

Line 14 calculates the next 4 key frequencies

Line 15 prints the corresponding key frequency

You might be interested in
How is knowing how to use word or docs importamt?
ollegr [7]
For 90% of users, the word processing capabilities of Google Docs is more than enough. But for some, Microsoft Word's advanced features will be important. ... You also get far more powerful templates, which could speed up your work, depending on what you use Word for.
3 0
3 years ago
The height of a small rocket y can be calculated as a function of time after blastoff with the following piecewise function: y 5
SOVA2 [1]

Answer:

High level Language

understand

Explanation:

rocket is 0...4433456u888

5 0
3 years ago
Write the function "zipper". the function will take two array/list/table parameters and return a new array/list/table which will
MakcuM [25]
What is the problem what am I supposed to do?
4 0
4 years ago
Edhesive code practice 4.8 Question 3
vovangra [49]

Answer:

for i in range(200,301,2):

  print(i)

Explanation:

just copy and paste 100 percent

3 0
3 years ago
Read 2 more answers
What is professionalism and unprofessionalism in the work place?​
Dmitrij [34]

Answer:

Professionalism means communicating effectively and appropriately and always finding a way to be productive. Employers want new workers to be responsible, ethical, and team oriented, and to possess strong communication, interpersonal, and problem solving skills. Wrap these skills up all together and you've got professionalism.

There are many types of unprofessional behavior in the workplace, which include habitual tardiness, absence, harassment or bringing personal issues to the job. These behaviors can cause disruption to the company as a whole, which means they should be dealt with as soon as possible.

8 0
3 years ago
Other questions:
  • How many times do you usually use npm?<br> Put your answer in the box.
    6·1 answer
  • Sally needs to copy data from the first worksheet to the fifth worksheet in her workbook. Which combination of keys will she use
    6·2 answers
  • Identify which statement explains why a programmer would break a logic problem into steps.
    13·2 answers
  • Xavier would like to change the sort options for his contacts. In which tab will he find the Arrangement command group?
    6·1 answer
  • Air circulation is caused by ... A Earth's rotation around the sun B winds that move vertically C moving air between hot and col
    11·1 answer
  • How many pieces can be connected on to a to an SPS​
    11·1 answer
  • Can someone please give me timetable managment system with data structures in java?
    11·2 answers
  • What is a mod in programming?<br><br> Give more Java questions
    12·1 answer
  • Please help me on this I don't know which one they are​
    6·2 answers
  • Hi, I am from India. Our brainly platform isn't so good, many of 'em keep spamming questions that I ask. US platform seems much
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!