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;
}
Step-by-step 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