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
What is a hash function? A. A function that computes the location of the values in the array B. A function has allocated memory
galina1969 [7]

Answer:

A hash function is a function which when given a key, generates an address in the table. The example of a hash function is a book call number. Each book in the library has a unique call number. ... The later is always possible only if you know (or approximate) the number of objects to be proccessed.

Explanation:

A

3 0
3 years ago
Read 2 more answers
A working model of a new product for testing purposes.
kotykmax [81]
Prototype is a working model for a product only for  testing purposes
6 0
3 years ago
_________ is the start up sequence a computer conducts.
Travka [436]

Answer:

Booting

Explanation:

Booting is the start up sequence a computer conducts when it is being turned on. The booting is done by the operating system. The booting process is usually started when a hardware on the computer is pressed or by a software command. For a windows computer, the BIOS is used to start the booting sequence. These boot sequence is called boot order or BIOS boot sequence.

6 0
4 years ago
Once a virus has been removed by your anti-virus program, all traces of it are gone from your computer.
pychu [463]
Im pretty sure that is false
5 0
3 years ago
Perform algorithm time measurement for all three quadratic sorting algorithms for Best Case (already sorted), Average Case (rand
Kaylis [27]

Answer:

Experiment size : 50,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 0.162

Average case : 0.116

Best case : 0.080

Insertion sort :

---------------------------------------------------------

Worst case : 0.162

Average case : 0.116

Best case : 0.080

Bubble sort:

--------------------------------------------------------

Worst case : 0.211

Average case : 0.154

Best case : 0.117

Experiment size : 100,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 0.316

Average case : 0.317

Best case : 0.316

Insertion sort :

---------------------------------------------------------

Worst case : 0.316

Average case : 0.317

Best case : 0.316

Bubble sort:

--------------------------------------------------------

Worst case : 0.482

Average case: 0.487

Best case : 0.480.

Experiment size : 200,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 1.254

Average case : 1.246

Best case : 1.259

Insertion sort :

---------------------------------------------------------

Worst case : 1.254

Average case : 1.246

Best case : 1.259

Bubble sort:

--------------------------------------------------------

Worst case : 1.990

Average case : 2.009.

Best case : 1.950

Explanation:

[NB: since it is very long there is the need for me to put it it a document form. Kindly check the doc. Files. The file A is the sort Analysis.Java file and the file B is the sort.Java file].

The concept of algorithm time measurement strictly depends on the following;

=> The measurement of time, space or energy on different sizes.

=> Plotting of the measurements and characterizing them.

=> Running or implementation of the algorithm.

Programming language such as Java can be used in accessing the operating system clock and Java had two static methods.

KINDLY CHECK BELOW FOR THE ATTACHMENT.

Download doc
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> doc </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> doc </span>
5 0
3 years ago
Other questions:
  • which of the following is not an operating system? A. leopard B. linux C. firefox D. windows
    11·2 answers
  • What does the Sort feature do with a database
    13·1 answer
  • All of these are required categories on a safety data sheet except
    14·2 answers
  • Simplify (6x+6)+(-3-4x) please hurry!!!!!
    6·1 answer
  • Which Excel tool adjusts the values in multiple input cells to either maximize, minimize, or reach a specific output value given
    11·1 answer
  • Two of the following tasks would most likely be completed by a biomedical engineer?
    7·1 answer
  • when you assign a(n) ___ to a field, Access will display the value you assign, rather than the field name, in datasheets and in
    15·1 answer
  • What is the color of red?
    9·2 answers
  • Can some help me on this"..... / ..--- ..--- / ..... / .---- ---.. / .---- ----. / ..... / ..... / .---- ....- / ..--- ----- / .
    6·1 answer
  • In what ways can information be slanted in a news report?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!