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
Morgarella [4.7K]
3 years ago
15

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.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:

print('{:.2f} {:.2f} {:.2f} {:.2f} {:.2f}'.format(your_value1, your_value2, your_value3, your_value4, your_value5))

Ex: If the input is:

440
(which is the A key near the middle of a piano keyboard), the output is:

440.00 466.16 493.88 523.25 554.37
Computers and Technology
1 answer:
lesantik [10]3 years ago
8 0

Answer:

In C:

#include <stdio.h>

#include <math.h>

int main(){

   float f0,r,temp;

   r = pow(2.0,1.0/12);

   printf("f0: ");    scanf("%f", &f0);

   temp = f0;

   for(int i = 0; i<=4;i++){

       f0 = f0 * pow(r,i);

       printf("%.2lf ", f0);

       f0 = temp;    }

   return 0;

}

Explanation:

This declares f0, r and temp as float

   float f0,r,temp;

This initializes r to 2^(1/12)

   r = pow(2.0,1.0/12);

This prompts the user for f0

   printf("f0: ");    scanf("%f", &f0);

This saves f0 in temp

   temp = f0;

This iterates the number of keys from 0 to 4

   for(int i = 0; i<=4;i++){

This calculates each key

       f0 = f0 * pow(r,i);

This prints the key

       printf("%.2lf ", f0);

This gets the initial value of f0

       f0 = temp;    }

   return 0;

You might be interested in
Alison is having a hard time at work because her Inbox is flooded with emails every day. Some of these emails are unsolicited. S
EastWind [94]

Answer:

create another email for a buisness and private/personal. important emails will go to her personal while junk and un needed emails will go to the buisness

Explanation:

8 0
3 years ago
Read 2 more answers
Your development team is planning to host a development environment on the cloud. This consists of EC2 and RDS instances. This e
nata0808 [166]

The type of instances would you use for this purpose is known as On-Demand.

<h3>What is an on demand instance?</h3>

On-Demand Instances is known to be one that allows a person to pay for compute capacity usually by the hour or second with no long-term payment.

This is one that gives one a level of freedom from the costs and complexities of planning, purchasing, and keeping hardware.

Learn more about cloud from

brainly.com/question/25130975

8 0
3 years ago
Why is Abraham called the Father of Believers?
mixer [17]
Because of his strong faith,demonstrated again and again in difficult acts of obedience,

3 0
3 years ago
Xavier buys a new laptop for $540. He makes a down payment $75 and pays the rest in 6 equal monthly payments, p. What equation r
mylen [45]

Explanation:

so you want to subtract 540-75=465

so 465 is what he has to pay total so now we break it up into equal parts

465/6=77.5

so he would pay $77

3 0
3 years ago
LOOK TO THE LEFT AND RIGHT BEFORE ENTERING ANY INTERSECTION ON A GREEN LIGHT BECAUSE:
AleksandrR [38]
The answer is A. D could be true, but if you have green, they would have a red hand, and not right-of-way
7 0
4 years ago
Read 2 more answers
Other questions:
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    10·1 answer
  • Which of the following commands is more recommended while creating a bot?
    9·1 answer
  • A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
    10·1 answer
  • What part of the computer gives access to the internet
    10·1 answer
  • How does LinkedIn differ from other popular social media platforms? What are the similarities?
    6·1 answer
  • In the writing and language test of the SAT, questions ask students to do which of the following? A. Write an essay B. Define a
    14·2 answers
  • Which of the following would be useful to understand if you wanted to build a web page
    15·1 answer
  • What color mode would you use when designing for web &amp; devices?
    9·1 answer
  • You attempt to telnet to system 192.168.1.240. You receive the following message: "Connecting To 192.168.1.240...Could not open
    5·1 answer
  • Im boing exam help please In a category-based course grading system, teachers weigh a student's performance in all courses. all
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!