Output that frequency and the next 3 higher

Assignment Help Basic Computer Science
Reference no: EM132200911

On a piano, each key has a frequency, and each subsequent key (black or white) is a known amount higher. Ex: The A key above middle C key has a frequency of 440 Hz. Each subsequent key (black or white) has a frequency of 440 * rn, where n is the number of keys from that A key, and r is 2(1/12). Given an initial frequency, output that frequency and the next 3 higher key frequencies. If the input is 440, the output is: 440 493.883 523.251 554.365.

Note: Include one statement to compute r = 2(1/12) using the pow function, then use r in the formula fn = f0 * rn. (You'll have three statements using that formula, different only in the value for n).

(Note 4/17/17: A student noticed that our example and test cases are skipping n=1, starting instead with n=2. We won't change the lab right now, so just assume you've been asked for steps n=2, 3, and 4.)

starting code:

#include <iostream>

#include <cmath>

using namespace std;

int main() {

  int startingFrequency; 

  /* start code here. Include the math library above first. */

  return 0;

}

Reference no: EM132200911

Questions Cloud

Write a program that determines the largest of 3 integers : Write a Java Program that determines the largest of 3 integers. User prompt that asks the user to input 3 integers.
What is conditional formatting : 1. What is conditional formatting? 2. Describe how to format a table.
Write a java program to display a dialog box : Write a Java program to display a dialog box that asks you to enter your user name and the age.
What economic forces might be responsible for the change : In the single graph, show how the labor force participation rate for men and also for women have changed over time. What do you notice?
Output that frequency and the next 3 higher : Given an initial frequency, output that frequency and the next 3 higher key frequencies. If the input is 440, the output is: 440 493.883 523.251 554.365.
Write a java program that can convert an letter grade : Write a JAVA program that can convert an letter grade A,B,C,D and display it corresponding numeric value 4,3,2,1 or 0.
Rectangle length times its width : The area of a rectangle is the rectangle's length times its width. Can someone draw an example flowchart that asks for the length and width of two rectangles
User input number is odd or even : Can you type up a pseudocode, that has a module check that decides if a user input number is odd or even. Any programming language is fine, it's just a test pse
At what price does the firm make zero profits : Assume that w = r = 1 and that k = k. Suppose that half of the fixed cost is nonsunk. For the following production function, derive the short-run supply.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Program that reads a sequence of integers into an array

Write a program that reads a sequence of integers into an array and that computes the alternating sum of all elements in the array

  Most common methods of protecting code

This exercise looks at reverse engineering and \cracking" applications. For this exercise you should log into the VM as user: dan, password: dan!dan. In Dan's home directory you will nd two jarles, two ELF executables, the tool JD-GUI and the eval..

  Opportunity cost of skipping practice and going to fair

The opportunity cost of skipping practice and going to fair, valued in dollars, is?

  Explaining data visualization form of business intelligence

Is data visualization a form of business intelligence? Describe why or why not? What security issues are related with data visualization?

  Explain the need to move from ipv4 to ipv6

Discuss and explain the need to move from IPv4 to IPv6. Include discussion about the advantages and disadvantages of each.

  What is the order of the functions

What is the order of the functions

  What is the degree m of the key stream generator

Draw a circuit diagram and verify the output sequence of the LFSR.

  Find the maximum current through the 5 resistors

Find the maximum current through the 5-Ω resistors and determine the value of n .

  How salespeople could be give remote access to system

Describe how salespeople could be give remote access to this system by using RemoteApp. Are there any concerns about using RemoteApp?

  Why this method will not only speed up the convergence

The iteration continues until k centers are selected. Explain why this method will not only speed up the convergence of the k-means algorithm, but also guarantee the quality of the final clustering results.

  What is the value of the swap

Suppose that the LIBOR zero rate is flat at 5% with annual compounding. In a five-year swap, company X pays a fixed rate of 6% and receives LIBOR annually on a principal of $100 million. The volatility of the two-year swap rate in three years is 2..

  Class diagram for a book comprising chapters

Draw a class diagram representing a book defined by the following statement. "A book is composed of a number of parts, which in turn are composed of a number of chapters.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd