Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

On a piano, a key has a frequency, say f 0 . Each higher key ( black or white ) has a frequency of f

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.0/12.0). Given an initial key frequency, output that frequency and the next 4 higher key frequencies.
Output all frequencies with five digits after the decimal point, which can be achieved as follows:
Put frequency to output with 5 decimal places
Ex: If the input is:
440.0
(which is the A key near the middle of a piano keyboard), the output is:
440.00000466.16376493.88330523.25113554.36526
Note: Use one statement to compute r =2(1.0/12.0) using the RaiseToPower() function. Then use that r in subsequent statements that use the formula fn = f0* rn with n being 1,2,3, and finally 4.
Interesting Fact: Floating point numbers are stored in the computer with the maximum precision the computer supports. We use floating point numbers keeping that precision for all the mathematical operations, and when we want to display the output for people, we display only the number of decimal points that people want to see. If we were displaying an amount that represented money, for example, we would display dollars and cents, that is 2 digits after the decimal place. In this program, we are doing scientific calculations, and so we decided in this program to display 5 digits after the decimal place.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel 2024 In 7 Days

Authors: Alan Dinkins

1st Edition

B0CJ3X98XK, 979-8861224000

More Books

Students also viewed these Databases questions

Question

1. What are the pros and cons of diversity for an organisation?

Answered: 1 week ago

Question

1. Explain the concept of diversity and equality in the workplace.

Answered: 1 week ago